I just started using Macros and need some help. Using Excel 2007 I managed to record a Macros and everything seems to be working except for the File Save as part.. I need to set it to use the orignal file name but the format set to csv instead of xls.
I have several folders with excel sheets named January to December, Once the Macros is complete, I want to keep the same file name but set the format to csv.
Here is the last paragraph of the macros
The file I used to test was January.xls and Saved it as Month.csv when recording the Macros, but when I run the Macros on February.xls it gives an error as Month.csv already exists.. If possible I would like each month to still have the Month name (i.e January.csv, February.csv etc), instead of the filename being Month.csv
I would also like it to use the original folder/current directory where the xls was opened from.
I have several folders with excel sheets named January to December, Once the Macros is complete, I want to keep the same file name but set the format to csv.
Here is the last paragraph of the macros
Code:
ChDir _
"C:\Documents and Settings\User\My Documents\ST\Time Tables\cONVERTING\KlerkTest\ptc30 generated"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\User\My Documents\ST\Time Tables\cONVERTING\KlerkTest\ptc30 generated\Month.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
The file I used to test was January.xls and Saved it as Month.csv when recording the Macros, but when I run the Macros on February.xls it gives an error as Month.csv already exists.. If possible I would like each month to still have the Month name (i.e January.csv, February.csv etc), instead of the filename being Month.csv
I would also like it to use the original folder/current directory where the xls was opened from.