MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Saving spreadsheet with file name and current date

Posted by Shadde Wicks on February 14, 2002 7:42 AM

Our MRP system generates reports in Excel which I manipulate with macros. The reports always have the same name and my macro saves them to a directory using that name. My problem is every time I run the macro last week's report gets written over. Is there a way to have the macro save the file as the report name + the current date so I don't get over written files? Any advice would be greatly appreciated.

Posted by Phil on February 14, 2002 9:08 AM

This should do the trick:

ActiveWorkbook.SaveAs "C:\DirectoryName\FileName " & Format(Now, "dd-mmm-yy") & ".xls"