Help With Macro

K

Keven

I have written an excel 2003 macro that imports a comma
delimited text file and makes a couple of basic formating
changes to it. what I would like to do is find a way that
I could save this file with a file name of (current
date).xls any help with this would be greatly appreciated.


Thanks,
Keven
 
C

chris

Public Sub SaveAsDate()
ActiveWorkbook.SaveAs Filename:= CStr(Format(Now, "mmmm dd yyyy")
End Su

----- Keven wrote: ----

I have written an excel 2003 macro that imports a comma
delimited text file and makes a couple of basic formating
changes to it. what I would like to do is find a way that
I could save this file with a file name of (current
date).xls any help with this would be greatly appreciated


Thanks
Keve
 
G

Guest

That save it in a date format, but for some reason in is
saving it as a .txt file, I would like it to save as .xls
workbook if that is possible ?

Thanks,
Keven
 
B

Bill Renaud

ActiveWorkbook.SaveAs Filename:=CStr(Format(Now, "mmmm dd yyyy")), _
FileFormat:=xlNormal

Since you opened a text file and are now saving it again after a few
changes, I believe that the SaveAs method uses the same format by default. A
normal Excel format is used when the file to be saved is a new one.
Therefore, you have to specify the FileFormat argument. This is one of those
tricky cases where you have to read the VBA Help topics very carefully.
 
Top