Dynamically Name Excel File?

Soldato
Joined
19 Dec 2006
Posts
9,262
Location
Saudi Arabia né Donegal
Howdy,

Just wondering if it's possible to dynamically name a file for saving in excel:

For example

filename-current date.xlsx

Where the current date changes to match todays date?
 
as above, it can be done easily in vba, will try and post full solution when i'm not on my phone.
 
at it's simplest.

Code:
Sub save()
ActiveWorkbook.SaveAs Filename:="filename-" & Format(Date, "ddmm")
End Sub

Will save the file when the macro is activated and add today's date to the end of the filename.
 
Back
Top Bottom