PDA

View Full Version : question reqarding macro recording in excel


jean73
04-28-2006, 03:07 PM
I have a macro recorded in excel to import a text file and save it as a csv file. Is there a away to code the macro to automatically save the file as the file name being imported?

Here is the code to import and to save. I need to save as the same name imported, plus I need to automate this code.

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;U:\CS_America.A2006113.txt", Destination:=Range("A2"))
.Name = "CS_America.A2006113_2"
---
---
---

ActiveWorkbook.SaveAs Filename:="U:\Copy of header2.csv", FileFormat:=xlCSV _
, CreateBackup:=False

Thanks for any help
Jean