Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to save Excel file with date and time in the file name?
Does someone out there have a macro that when executed would save the current
Excel spreadsheet in the form "filename-current date-current time.xls" and leave the file open for editing? Ideally, I would like to pin the macro to a button on the user's toolbar. Thank you for you help in advance. Troy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to save Excel file with date and time in the file name?
With Activeworkbook .SaveAs .Filename & "-" & Format(Now,"dd-mmm-yyyy-hh-mm-ss") End With -- HTH RP (remove nothere from the email address if mailing direct) "sonic_d_hog" wrote in message ... Does someone out there have a macro that when executed would save the current Excel spreadsheet in the form "filename-current date-current time.xls" and leave the file open for editing? Ideally, I would like to pin the macro to a button on the user's toolbar. Thank you for you help in advance. Troy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to save Excel file with date and time in the file name?
"sonic_d_hog" wrote in message
... Does someone out there have a macro that when executed would save the current Excel spreadsheet in the form "filename-current date-current time.xls" and leave the file open for editing? Ideally, I would like to pin the macro to a button on the user's toolbar. Thank you for you help in advance. Troy If you already have a file named Xxxxxx-date-time.xls: ========================= Public Sub SaveAsDateTime() With ActiveWorkbook .SaveAs Left(ActiveWorkbook.FullName, _ InStr(1, ActiveWorkbook.FullName, "-")) _ & Format(Now, "yyyymmdd-hhmmss") & ".xls" End With End Sub ========================= Ciao Bruno |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
customer date time save file | Excel Discussion (Misc queries) | |||
Save File with Date and Time Stamp | Excel Programming | |||
Save File with the current date and time. | Excel Programming | |||
Save file with time date stamp | Excel Programming | |||
Macro needed; save a file two (or more places) at the same time | Excel Programming |