Jump to content

saving with date stamp


discarnet

Recommended Posts

Hi all

Is it possible to save a single spread sheet with a date stamp in the name.

for instance i need to archive a spread sheet daily but dont want to lose the information from yesterday.

I want to be able to put a 'SAVE' command button on the sheet that saves it as 01/01/06 spreadsheet.xls , 02/01/06 spreadsheet.xls ect

I am a complete id*** when it comes to macros/visual basic so a dum dum's guide would be great

Thanks

Link to comment
Share on other sites


You can probably work with something like this macro:

http://vbaexpress.com/kb/getarticle.php?kb_id=38

If you don't ALSO want the value of cell A1 in the file name, just change the code to:

Option Explicit

Sub SvMe()

Dim newFile As String

' Don't use "/" in date, invalid syntax

'Change the date format to whatever you'd like, but make sure it's in quotes

newFile = Format$(Date, "mm-dd-yyyy")

'Or perhaps newFile = "myBook-"&Format$(Date, "mm-dd-yyyy")

' Change directory to suit your PC, including USER NAME

ChDir _

"C:\Documents and Settings\ USER NAME \Desktop"

ActiveWorkbook.SaveAs Filename:=newFile

End Sub

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...