Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Add todays date to file


Hi all,

just complete the send email tutorial, just wondering how to add the current date to the file and not the timer




Hello semaj,

If you could be more specific which tutorial you completed, or upload a sample file (with no personal information) so we can see your macro code would be helpful.

Where do you want the date to be added? The file name? The subject line? The email body? Where the date will be added will determine what coding is needed.

Cheers   :-)
WillieD24 (rep: 352) Aug 20, '23 at 12:59 pm
Add to Discussion



how to add file path in the printout in excel



Try again please- that "answer" conveys no information. 
John_Ru (rep: 5572) Aug 21, '23 at 10:53 am
Add to Discussion

i worked out the code i wanted, i re watched the tutorial and added the below to the filename to append the current date

 newFilename = "C:\Status_Report\Project Status Report PDF " & Format(Date, "yyyy-mm-dd") & ".pdf"



Thanks for updating your post and letting us know how you solved your issue. Your solution is what I had in mind if you wanted the date in the file name - which you did.

Cheers   :-)
WillieD24 (rep: 352) Aug 30, '23 at 11:12 am
@Semaj - for future, please note that you'll get a faster response if you reply to questions like Willie's (dated 20 Aug, under the Discussion to your Question). 

I think the other "Answer" was someone wanting to ask a similar question (but i got no response to my Discussion point also 20 Aug)
John_Ru (rep: 5572) Aug 30, '23 at 1:29 pm
sorry team got side tracked with work. 
semaj (rep: 2) Aug 31, '23 at 3:42 am
Delays happen so no problem. Note that if you get a working Answer, some feedback is nice but you really should mark it as Selected- you forgot to do that on my Answer about saving a file to a user's OneDrive.
John_Ru (rep: 5572) Aug 31, '23 at 6:25 am
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login