How do you save your file while working in Excel?
- Do you click the Save button, and save over the previous version?
- Do you use Excel’s AutoSave feature?
- Or the AutoSafe utility by Jan Karel Pieterse?
- Do you choose Save As, and save the file with a different name?
- Something else?
Macro to SaveAsCopy
I like to have different versions of a file, so I can go back to a previous version if something goes horribly wrong.
So, I created a macro to save my files, and added a button to the Quick Access Toolbar (QAT).

What the Macro Does
The macro saves a copy of the active file in a specified folder, adding the year, month, day, hour and minute to the file name.
For example, if the file I’m working on is named Budget2009.xls, the backup file would be named Budget2009_20081215_1008.xls if I saved it at 10:08 AM today.
NOTE: This macro does not make any changes to the active workbook, so it does NOT wipe out the Undo stack in my version of Excel. Test this on your own computer though, to make sure it’s the same for you!
The Backup Macro Code
Copy the macro below, and store it on a regular code module, in a workbook that is always open, such as the Personal Workbook.
In the code, you can change the Save directory to one that you prefer on your computer or network.
NOTE: I use C:\Backups\, but you could change that to another directory that you use.
Sub SaveBUCopy() Dim strFile As String Dim strName As String Dim lExt As Long Dim strDir As String Dim strExt As String strName = ActiveWorkbook.Name strDir = "C:\Backups\" If UCase(Right(strName, 4)) = ".XLS" Then lExt = 4 Else lExt = 5 End If strFile = Left(strName, Len(strName) - lExt) strExt = Right(strName, lExt) ActiveWorkbook.SaveCopyAs strDir & strFile _ & Format(Now, "_yyyymmdd_HhMm") & strExt End Sub
Add Button to QAT
After you’ve added the SaveBUCopy macro to your workbook, and changed the directory name, make the macro easy to run.
To do that, follow the steps in this video, to add your macro to the Quick Access Toolbar.
There are written steps on my Contextures website — Add a Macro to the QAT.
______________________________


















