Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save file with todays date ref#11235 [email protected] Excel Worksheet Functions 2 January 29th 09 06:59 PM
Recovering File Info Specifically Save Date or Print Date Gadgetgw Excel Discussion (Misc queries) 4 October 6th 08 08:43 PM
Saveing workbook to a file as todays date daily mikespeck Excel Worksheet Functions 0 August 22nd 06 01:27 PM
When I open my past invoice it keeps changing date to todays date Stop date changing to todays in Excel Excel Worksheet Functions 2 October 7th 05 04:54 PM
Automatic Populate Todays Date in Cell when File is Saved. Nello Excel Discussion (Misc queries) 3 April 21st 05 11:08 PM


All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"