![]() |
Convert csv to Excel files
I have around 100 excel worksheets stored in csv format in one single folder.
I have to save each and every single csv worksheet to xls format which is a very cumbersome job. Pls provide me with some macro which automatically converts all csv files stored in folder to xls format. Ideally that macro should first ask me to point to location where all csv files are located and then it should convert all files to xls format. |
Convert csv to Excel files
Try (you may have trouble with pre XL2003 versions) :
Sub test2() Dim myFolder As String, myFile As String With Application.FileDialog(msoFileDialogFolderPicker) .Show myFolder = .SelectedItems(1) End With myFile = Dir(myFolder & "\*.csv") Do While myFile < "" Workbooks.Open myfilder & myFile ActiveWorkbook.SaveAs myFolder & "\" & Left(myFile, Len(myFile) - 4) & ".xls", xlNormal ActiveWorkbook.Close myFile = Dir Loop End Sub -- Regards. Daniel "nc" a écrit dans le message de news: ... I have around 100 excel worksheets stored in csv format in one single folder. I have to save each and every single csv worksheet to xls format which is a very cumbersome job. Pls provide me with some macro which automatically converts all csv files stored in folder to xls format. Ideally that macro should first ask me to point to location where all csv files are located and then it should convert all files to xls format. |
All times are GMT +1. The time now is 01:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com