Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Everyone!
Can anyone show me the code for a macro that will format a folder full of CSV files to XLS files automatically. Thanks Dave |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dave,
Try the macro below. Just change the path to your folder.... HTH, Bernie MS Excel MVP Sub TransformCSVToXls() Application.DisplayAlerts = False myFile = ActiveWorkbook.Name myPath = "C:\Documents and Settings\DEITBE\My Documents\Excel\Delete These\" WorkFile = Dir(myPath & "*.CSV") Do While WorkFile < "" Application.StatusBar = "Now working on " & WorkFile Workbooks.Open FileName:=myPath & WorkFile MsgBox ActiveWorkbook.Name ActiveWorkbook.SaveAs FileName:=myPath & _ Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4), FileFormat:=xlNormal ActiveWorkbook.Close Windows(myFile).Activate WorkFile = Dir() Loop Application.StatusBar = False End Sub "Dave" wrote in message ... Hi Everyone! Can anyone show me the code for a macro that will format a folder full of CSV files to XLS files automatically. Thanks Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
batch file | Excel Discussion (Misc queries) | |||
batch delete | Excel Discussion (Misc queries) | |||
batch printing without VBA | Excel Discussion (Misc queries) | |||
Batch change | Excel Discussion (Misc queries) | |||
How batch calculations? | Excel Worksheet Functions |