Hi,
Is it possible to use a macro to covert 140 files in one folder from.csv to .xls format, and then delete the .csv files?
Thanks
Hi,
Is it possible to use a macro to covert 140 files in one folder from.csv to .xls format, and then delete the .csv files?
Thanks
Last edited by timbo1957; 06-29-2011 at 09:11 AM.
Sure, something like this:
![]()
Sub test() Dim strDir As String, strFileName As String strDir = "C:\TEST\" strFileName = Dir(strDir & "*.csv") Do While strFileName <> "" Workbooks.Open strDir & strFileName ActiveWorkbook.SaveAs strDir & Left(strFileName, Len(strFileName) - 4) & ".xls", xlNormal ActiveWorkbook.Close False Kill strDir & strFileName strFileName = Dir Loop End Sub
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Thanks Domski,
Brilliant!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks