Excel like a finance pro.
Stamp the date every time the file is saved
An event macro that writes the save time into a cell — so a printed or emailed copy always shows how current it is.
1What it does
This is an event macro: instead of a button you run, it fires on its own every time the workbook is saved. It writes the current date and time into a cell named "LastSaved" (or A1 of the first sheet if you haven't named one), formatted so it reads cleanly. Because it runs on the save itself, an exported PDF or emailed copy is always stamped with exactly how fresh the numbers are — no one has to remember to update an "as of" cell. Event macros live in the ThisWorkbook module, not a normal module, which is what lets Excel run them automatically.
2The code
' Put this in the "ThisWorkbook" module (double-click ThisWorkbook in the
' Project pane, top-left), NOT a normal module — that's what lets it run
' automatically on every save.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error Resume Next
' Prefer a cell you've named "LastSaved" (Formulas -> Name Manager, or type
' the name in the Name Box). Fall back to A1 of the first sheet.
Dim stampCell As Range
Set stampCell = ThisWorkbook.Names("LastSaved").RefersToRange
If stampCell Is Nothing Then
Set stampCell = ThisWorkbook.Worksheets(1).Range("A1")
End If
stampCell.Value = Now
stampCell.NumberFormat = "mmm d, yyyy h:mm AM/PM"
On Error GoTo 0
End SubPaste into the Visual Basic Editor (Alt + F11 → Insert → Module), then run and save as macro-enabled (.xlsm).
New to macros? Set up in 5 minutes▾
- 1
Don't see the Developer tab in the ribbon?
You don't strictly need it — Alt + F11 opens the editor directly — but it makes running macros easier.- Windows: File → Options → Customize Ribbon → tick Developer in the right-hand list → OK.
- Mac:Excel → Preferences → Ribbon & Toolbar → tick Developer → Save.
- 2
Paste in the code
Press Alt + F11 to open the Visual Basic editor, then Insert → Moduleand paste the snippet's code into the blank window. Close it with Alt + Q. - 3
Run it
Press Alt + F8, pick the macro's name, and click Run — that's it. (Pasted a custom function instead? Just type it into a cell like any built-in:=GrossMargin(B2, B3).) - 4
Keep the macro — save as .xlsm
File → Save As → Excel Macro-Enabled Workbook (.xlsm). A plain .xlsx silently drops the code when you save. - 5
Macros blocked?
Click Enable Content on the yellow bar. If you downloaded the file, you may first need to right-click it → Properties → tick Unblock → OK, then reopen.
Heads up: macros can't be undone with Ctrl + Z — save a copy before running one that changes your workbook.
3When you use it
- Show an always-accurate "as of" date on a report you print or email.
- Prove to a lender or client how current a workbook is.
- Track when a shared model was last touched, without a manual entry.
4See it in action
A simulation — press Run to perform what the macro does to a sample workbook.
Cell named “LastSaved”
| Last saved | — |
5Pitfalls
Nothing happens on save.
Fix: The code must go in the ThisWorkbook module (not Insert → Module), and macros must be enabled. Save as .xlsm.
The stamp shows a raw number like 46000.
Fix: The macro sets the cell's number format, but if it's overridden, format the cell as Date/Time yourself.
Saving feels like it loops.
Fix: Writing a value doesn't re-trigger a save here — but never call ThisWorkbook.Save inside BeforeSave, which would recurse.
6No-code alternatives
- =TODAY() / =NOW() — Volatile formulas that update on every recalc — they show today, not the last save.
- Insert → Header/Footer — Excel can print a date in the footer, though it prints the print date, not the save date.
- File → Info — Excel already tracks 'Last Modified' in the document properties — just not inside a cell.
Rather not write macros? Wauvel's free tools generate branded, formula-driven Excel for you — no VBA required.
Learn the moves here — or let Wauvel run them on your numbers.
Meet your AI CFO →One CFO-grade Excel tip a week
A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.