daren.beaney
New Member
- Joined
- Jun 14, 2011
- Messages
- 16
Hi, I've got this code that allows me to create a backup copy of my workbook however I can't find any code that I can include that will save the copy to defined folder location e.g. "G:\My Documents\Temp\AMP\Archive"
I'm sure it's easy but I can't find anything that seems to work with this code structure
This is the code as it stands which saves a copy into the same folder location (AMP):
Thanks in advance!
I'm sure it's easy but I can't find anything that seems to work with this code structure
This is the code as it stands which saves a copy into the same folder location (AMP):
Code:
Sub SaveArchive()
Dim sFileName As String
Dim sDateTime As String
With ThisWorkbook
sDateTime = " (" & Format(Now, "dd-mm-yy hhmm") & ").xlsm"
sFileName = Application.WorksheetFunction.Substitute _
(.FullName, ".xlsm", sDateTime)
.SaveCopyAs sFileName
End With
End Sub
Thanks in advance!