how do I get a macro to save a sheet and set the file name?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet that changes daily and needs to save the file
differently each day. The program wont allow you to "save as" then paste
something like the date as the file name. How do I get the macro to change
the filename each time it needs to save. This can be by and increment of say
1?
 
Here is a typical format for the save:

Sub saversion()
s = Format(Date, "yyyy_mm_dd")
ChDir "C:\Documents and Settings\Owner\Desktop"
ActiveWorkbook.SaveAs Filename:="DailyFile " & s
End Sub


If you run the macro today the file name would be :

DailyFile 2007_09_16.xls
 
Back
Top