开发者

keyboard shortcut csv file column header width autofit in excel

开发者 https://www.devze.com 2023-03-15 09:12 出处:网络
CSV files are raw text data without any display information.The short answer is \"you can\'t.\" The longer answer is you can\'t do it with CSV files.However, you can save the file as a different form

keyboard shortcut csv file column header width autofit in excel


CSV files are raw text data without any display information. The short answer is "you can't."

The longer answer is you can't do it with CSV files. However, you can save the file as a different format that includes display information along with the data (eg, XLS, or even HTML tables imported into Excel). This might not even be an issue if the CSV requirement is for processing data through another program.


If you are using scripting of any sort to open the CSV in Excel, one possibility is to simply autosize all columns to fit after opening the file:

Worksheets("Sheet1").Columns("A:I").AutoFit

Of course, change I to the appropriate column needed.

Reference: AutoFit Method [Excel 2003 VBA Language Reference]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号