How to Track Cell Value Changes in Excel
In this article
Excel does not keep a built-in history of every cell edit, so tracking cell value changes means setting up one of three practical methods: a Worksheet_Change macro that logs old and new values to a separate sheet, manual versioning with a copied backup sheet, or the Track Changes feature (limited to shared workbooks and unavailable in Excel for the web and some Microsoft 365 builds). The macro approach is the only one that reliably records the previous value automatically, because Excel overwrites the old value the moment you press Enter. Everything below assumes a desktop version of Excel on Windows or Mac; the VBA editor and Track Changes behave differently or are missing on mobile and in the browser.
What You'll Need
- Excel for Windows or Mac (desktop). The macro method needs the Developer tab enabled and macros allowed in the file.
- A workbook saved as .xlsm (macro-enabled) if you plan to use VBA. A standard .xlsx will strip the code on save.
- A spare worksheet to act as the log, for example one named Log.
- For Track Changes: a workbook saved in the legacy shared-workbook format, which some newer Excel builds no longer offer.
Step-by-Step
Method 1: Worksheet_Change macro (recommended)
- Open the workbook and enable the Developer tab: File > Options > Customize Ribbon, then tick Developer in the right-hand list. On Mac, Excel > Preferences > Ribbon & Toolbar. Labels can differ slightly by version and region.
- Right-click the sheet tab whose cells you want to watch and choose View Code. The VBA editor opens with that sheet selected in the Project pane.
- Paste the following into the code window, adjusting the sheet name and range to match your file:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim watch As Range
Set watch = Me.Range("A1:A50")
If Intersect(Target, watch) Is Nothing Then Exit Sub
Application.EnableEvents = False
Dim c As Range, r As Long
For Each c In Intersect(Target, watch)
r = Sheets("Log").Cells(Rows.Count, 1).End(xlUp).Row + 1
With Sheets("Log")
.Cells(r, 1).Value = Now
.Cells(r, 2).Value = c.Address
.Cells(r, 3).Value = c.Value
End With
Next c
Application.EnableEvents = True
End Sub
- Create the Log sheet if it does not exist, or change "Log" in the code to the name of your log sheet.
- Save the file as .xlsm: File > Save As, choose Excel Macro-Enabled Workbook.
- Test it by typing a new value into a watched cell. A timestamp, the cell address and the new value should appear on the Log sheet.
This records the new value and the moment of change. To capture the old value too, you need a second macro that reads the cell before the edit, which is not possible with Worksheet_Change alone because the old value is already gone. The practical workaround is to keep a hidden "previous" copy of the watched range and have the macro compare against it, or to use the manual versioning method below.
Method 2: Manual versioning (no macros)
- Before editing, right-click the sheet tab and choose Move or Copy, tick Create a copy, and name it with a date, for example Data_2025-06-01.
- Make your edits on the live sheet.
- To compare, put both sheets side by side (View > New Window, then View > Side by Side) and use formulas such as =IF(Sheet1!A1<>Sheet2!A1,"changed","") in a third sheet.
- Repeat the copy at each milestone. This is slower but works in every Excel version, including the browser, and survives a crash.
Method 3: Track Changes
- Save the workbook as .xlsx first, because shared workbooks use the older format.
- Go to Review > Track Changes > Highlight Changes. If the button is greyed out, the feature is not available in your build; use Method 1 or 2 instead.
- Tick Track changes while editing, choose when and who, and click OK.
- Review edits with Review > Track Changes > Accept/Reject Changes. Note that this feature is being retired in newer Microsoft 365 builds, so do not rely on it for long-term records.
Common Mistakes
- Saving as .xlsx after adding VBA. The code is silently removed; always keep an .xlsm copy.
- Forgetting Application.EnableEvents = False in the macro, which causes an infinite loop when the macro writes to the log sheet and triggers itself.
- Watching the whole sheet instead of a defined range, which slows large workbooks and fills the log with irrelevant edits.
- Assuming Track Changes works in Excel for the web or on mobile. It does not; use manual versioning there.
- Expecting the macro to record the old value automatically. It cannot, because Excel replaces the value before the event fires.
Tips
- Keep the Log sheet hidden (right-click tab > Hide) so users do not overwrite the history.
- Add a header row to the Log sheet and freeze it for readability.
- Log the workbook user with Environ("USERNAME") if several people edit the same file, but note this is not secure identification.
- For shared files, store the log on a separate sheet and protect it with Review > Protect Sheet so it cannot be cleared accidentally.
- If you only need to know that a cell changed, conditional formatting with a formula rule is lighter than a macro.
Troubleshooting
- Nothing appears in the log: check that macros are enabled (File > Options > Trust Center > Macro Settings), that the file is .xlsm, and that the watched range in the code matches the cells you edited.
- Excel freezes after an edit: the macro is probably triggering itself. Press Esc, open the VBA editor, and confirm Application.EnableEvents = False is set before any write to the log.
- Track Changes is greyed out: your build has retired the feature or the workbook is not shared. Switch to the macro or manual method.
- The log shows the wrong sheet name: the code uses Sheets("Log"); rename the sheet or update the string to match exactly, including spaces.
- Macros stopped working after an update: re-enable the Developer tab and check Trust Center settings; some updates reset macro permissions.
Frequently Asked Questions
Can Excel show me the previous value of a cell?
Not natively after the edit. Undo (Ctrl+Z) works only in the current session. For a permanent record you need a macro log or manual version copies.
Does Track Changes work in Excel for the web?
No. It is a desktop-only feature and is being retired in newer Microsoft 365 builds. Use a macro or saved copies instead.
Will the macro log changes made by formulas?
No. Worksheet_Change fires on manual entry, not on formula recalculation. To log formula results you would need Worksheet_Calculate, which is heavier and less precise.
Can I track changes without enabling macros?
Yes, by saving dated copies of the sheet and comparing them with formulas. It is manual but works everywhere, including mobile and the browser.
Is the change log secure?
No. Anyone with edit access can view or clear it unless you protect the sheet. Treat it as an audit aid, not a tamper-proof record.