Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
nc nc is offline
external usenet poster
 
Posts: 119
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I batch convert 97-2003 .xls files to 2007 .xlsx files Dave Nuttall Excel Discussion (Misc queries) 4 August 3rd 09 11:38 PM
Convert CVS files on Excel rto93 Excel Discussion (Misc queries) 1 March 28th 08 03:27 AM
Can I convert my Quatro Pro files to MS Excel files? James HW New Users to Excel 3 May 11th 06 04:42 PM
How do I convert PDF files to Excel? Kusko Excel Discussion (Misc queries) 2 March 11th 05 05:40 PM
Convert prn files to excel? ROYSTA Excel Discussion (Misc queries) 3 December 26th 04 03:47 AM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"