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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,215,200
Messages
6,123,612
Members
449,109
Latest member
Sebas8956

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