Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Convert Multiple CSV Files to XLS Files (Again)
Hi Everyone,
I am still trying to convert a folder full of CSV files to XLS files. In an earlier post I was given a macro, as shown he 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 I would really appreciate if someone could a) tell me if this macro actually will work, and b) edit it so that I can use it in my situation. I have a few requirements, being: * The folder containing the CSV files will be called GMS, and will be a subfolder of the macro i.e. C:\MACRO_IN_HERE\GMS\ * I do not want any message boxes or windows to pop up. I simply want the macro to open 20 or so csv files and change them all to XLS files. Thanks! Dave |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Convert Multiple CSV Files to XLS Files (Again)
Hi Dave
You can use this two macros First this one (see CSV macro) http://www.rondebruin.nl/txtcsv.htm Then you can use this macro to create a new workbook from every sheet http://www.rondebruin.nl/copy6.htm You can do it in one macro also but I have no time now to make one . -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Dave" wrote in message ... Hi Everyone, I am still trying to convert a folder full of CSV files to XLS files. In an earlier post I was given a macro, as shown he 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 I would really appreciate if someone could a) tell me if this macro actually will work, and b) edit it so that I can use it in my situation. I have a few requirements, being: * The folder containing the CSV files will be called GMS, and will be a subfolder of the macro i.e. C:\MACRO_IN_HERE\GMS\ * I do not want any message boxes or windows to pop up. I simply want the macro to open 20 or so csv files and change them all to XLS files. Thanks! Dave |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
converter tool to convert XL 2007 files to XL 2003 files | Excel Discussion (Misc queries) | |||
Can I convert my Quatro Pro files to MS Excel files? | New Users to Excel | |||
how to convert multiple XLS files to CSV? | Excel Discussion (Misc queries) | |||
How can I view files chronologically when opening multiple files | Excel Discussion (Misc queries) | |||
Convert multiple XLS files to TXT | Excel Discussion (Misc queries) |