Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Adding date for filename

How do automatically add date to my filename upon saving? I need to regularly
keep track of movements and need a daily backup of the excel file.
  #2   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Adding date for filename

This would require a "Before Save" macro. If you are sure you want to add
VBA to your workbook just for this function, then post back and someone will
help.

Vaya con Dios,
Chuck, CABGx3



"Wins07" wrote:

How do automatically add date to my filename upon saving? I need to regularly
keep track of movements and need a daily backup of the excel file.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Adding date for filename

Put this code into the Codemodule of the ThisWorkbook Object.

It will save a dated/timed copy whenever you save. It can be modified to only save a dated copy,
overwriting the previous saved copies from that day...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then Exit Sub
MsgBox "I'm about to save a dated copy...."
Application.EnableEvents = False
ActiveWorkbook.SaveCopyAs Filename:= _
Replace(ActiveWorkbook.Name, ".xls", _
" BU " & Format(Now, " yyyy-mm-dd hh-mm") & ".xls")
Application.EnableEvents = True

End Sub

HTH,
Bernie
MS Excel MVP


"Wins07" wrote in message
...
How do automatically add date to my filename upon saving? I need to regularly
keep track of movements and need a daily backup of the excel file.



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
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
Enter current date automatically in filename Megadrone Excel Worksheet Functions 1 January 25th 07 03:48 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
Adding a date to calender to automatially generate another date? Crystal Long Excel Worksheet Functions 1 January 3rd 06 10:19 PM
How to automate footers (filename/date) for all new spreadsheets? amgbd26 Excel Worksheet Functions 4 August 10th 05 10:01 PM


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

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

About Us

"It's about Microsoft Excel"