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

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top