Save file with date as nae file

Truiz

Active Member
Joined
Jul 14, 2014
Messages
339
Good day,

I'm trying to save a file with today's date in the format MM.DD.YYYY

How would I go about that?


Code:
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Something like:
Code:
 ActiveWorkbook.SaveAs Filename:="C:\Users\Joe4\" & Format(Date,"mm.dd.yyyy") & ".xlsx"
Change the file path and file extension to match your needs.
 
Upvote 0
Yeah thats what I was looking for, how do I prompt to change the file name in case the file name already exist?
 
Upvote 0
Another suggestion: save the file in YYYY.mm.dd.mm.ss and you will not be having collisions. Also, the name can be sorted or listed in chronological order within a main-name.
 
Upvote 0

Forum statistics

Threads
1,214,379
Messages
6,119,190
Members
448,874
Latest member
Lancelots

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top