How to save a document as current date ?

5 pts.
Tags:
Excel 2000
Excel macros
Microsoft Excel
VBA
Visual Basic for Applications
I'm using VBA in excel 2000 to create a macro that saves out a spreadsheet with today's current date. I cannot figure out the code that will achieve this function. Help Please

Answer Wiki

Thanks. We'll let you know when a new response is added.

You can use the Date$ function to get a String of format <i>mm-dd-yyyy</i>. You can then use this string with the Workbook.Close Workbook.SaveAs, etc. EG:

<pre>function saveWithDate(myWorkbook as Workbook)
Dim dateStr as String
dateStr = Date$
myWorkbook.SaveAs FileName:=dateStr & “.xls”
end function</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following