ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Save file as todays date (https://www.excelbanter.com/excel-discussion-misc-queries/229654-save-file-todays-date.html)

Rinto Syah

Save file as todays date
 
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


Per Jessen

Save file as todays date
 
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

"Rinto Syah" skrev i meddelelsen
...
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



Simon Lloyd[_208_]

Save file as todays date
 

Like this
Code:
--------------------

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

--------------------


Rinto Syah;332073 Wrote:
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



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=92811


Jacob Skaria

Save file as todays date
 
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

--
If this post helps click Yes
---------------
Jacob Skaria


"Rinto Syah" wrote:

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


Rinto Syah

Save file as todays date
 
Wow, this helps. Thanks Jacob...

"Jacob Skaria" wrote:

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

--
If this post helps click Yes
---------------
Jacob Skaria


"Rinto Syah" wrote:

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



All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com