View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
roryt roryt is offline
external usenet poster
 
Posts: 1
Default Save As file name + Today's Date using a macro

Please could someone tell me how to use a macro to Save a worksheet as the
filename + the date and then save it as it's previous name again. This is
to create a backup copy of the spreadsheet and then let the user work on the
previous spreadsheet from it's original filename. I am pretty sure this has
got to be in VBA. Here is the code I have found to save as filename+Date:

Private Sub SaveDatabaseButton_Click()
ActiveWorkbook.SaveAs Filename:= _
€œF:\User Form for Lessons Learned\Lessons Learned € _
& Format(Date, €œyyyymmdd €œ) & Format(Time, €œhh.mm.ss€) & €œ.xls€, _
FileFormat:=xlNormal, Password:=€", WriteResPassword:=€",
ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub

But because I am totally new to VBA I can't even get that to work!!! So i
really need someone to tell me exactly to get from start to finish (finish
being a point where I have a macro that will do what I have explained above).

If anyone can help I will be very very grateful. Thanks