I have tried to write code to autofit Cols A to D of all csv files in folder C:\Journals, but cannot get this to work
It would be appreciated if someone could kindly amend my codePlease Login or Register to view this content.
I have tried to write code to autofit Cols A to D of all csv files in folder C:\Journals, but cannot get this to work
It would be appreciated if someone could kindly amend my codePlease Login or Register to view this content.
To the best of my knowledge: You can't retain formatting such as column widths in a CSV file.
So the code may well does work, but when saving the CSV file and closing it, the column widths are lost again.
Try manually to change the column width, then save the CDV file and close it. Re-open the file. Columns will be back to default.
You could open the CSV files, autofit, then save as excel files if that does not cause other issues on how you need to work with these files.
If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.
Thanks for the feedback. The column width on the source sheets in Excel are fine but the sheets are exported as CSV files to be uploaded into an accounting software package that will only accept CSV files
At least now I know that the column width in a CSV file will always default to the specified CSV setting for col width
Again, column width does not exist within a csv file as it is nothing but a delimited text file !
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks