Hi there,
I have written a macro that modifies an excel file updating it with new data.
What I would like to do is to save the file before my macro does all the updating so I keep an "screenshot" of the data so I can track it back.
The closest I have got to it is the macro you can see below, which saves my file with the name I specify in cell A1 and date. So far all sounds good.
My only problem is that after saving the file open in Excel is not the original one I was working on, is the new one with the name from the cell A1.
Is there any way of saving a version of the doc you are working with another name but not opening it and keeping open the one you had.
Does this makes sense any sense? Hope is not too confusing.
Thanks for looking at this,
Sub Macro1()
'Saves filename as value of A1 plus the current date
Dim newFile As String, fName As String
' Don't use "/" in date, invalid syntax
fName = Range("A1").Value
'Change the date format to whatever you'd like, but make sure it's in quotes
newFile = fName & " " & Format$(Date, "mm-dd-yyyy")
' Change directory to suit your PC, including USER NAME
ChDir _
"C:\Documents and Settings\user\My Documents\"
ActiveWorkbook.SaveAs Filename:=newFile
End Sub
Bookmarks