discarnet Posted March 7, 2006 Share Posted March 7, 2006 Hi allIs 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 ectI 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 More sharing options...
Anne Troy Posted March 9, 2006 Share Posted March 9, 2006 You can probably work with something like this macro:http://vbaexpress.com/kb/getarticle.php?kb_id=38If 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 More sharing options...
discarnet Posted March 10, 2006 Author Share Posted March 10, 2006 Fantastic thank you been trying to work it out all weekworks great it was the formating the date that confussed meTim Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now