Question

  Asked: Apr 22 2008   7:15 PM GMT
  Asked by: Data Mgt


How to save a document as current date ?


Microsoft Excel, VBA, Excel macros, Excel 2000, 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

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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

function saveWithDate(myWorkbook as Workbook)
Dim dateStr as String
dateStr = Date$
myWorkbook.SaveAs FileName:=dateStr & ".xls"
end function
  • AddThis Social Bookmark Button

Browse more Questions and Answers on Microsoft Windows and Development.

Looking for relevant Microsoft Windows Whitepapers? Visit the SearchWinIT.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register