Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
Enter current date automatically in filename | Excel Worksheet Functions | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
Adding a date to calender to automatially generate another date? | Excel Worksheet Functions | |||
How to automate footers (filename/date) for all new spreadsheets? | Excel Worksheet Functions |