Save file as todays date

  • Thread starter Thread starter Rinto Syah
  • Start date Start date
R

Rinto Syah

I made a macro on the excel and at the end of the macro I save it on a new
file. Can I put the date when I save the file as part of the file name?

Here is copy the last part of the macro:

ActiveWorkbook.SaveAs Filename:= _
"O:\Shared Services\Finance\2009\IC\IC
Detail\IST_3_1_Update_ddmmyyyy.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
 
Hi

Try this:

MyDate = Format(Date, "ddmmyyyy")
ActiveWorkbook.SaveAs Filename:= _
"O:\Shared Services\Finance\2009\IC\IC Detail\IST_3_1_Update_" &
MyDate & ".xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

Regards,
Per
 
Use Format(Date,) as below.......Please modify the path...

strFileName = "c:\Update_" & Format(Date, "ddmmyyyy") & ".xls"
ActiveWorkbook.SaveAs Filename:=strFileName, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
 
Wow, this helps. Thanks Jacob...

Jacob Skaria said:
Use Format(Date,) as below.......Please modify the path...

strFileName = "c:\Update_" & Format(Date, "ddmmyyyy") & ".xls"
ActiveWorkbook.SaveAs Filename:=strFileName, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
 
Back
Top