Undo is built into Excel, so there is no setting you need to switch on. Press Ctrl+Z on Windows to reverse the last supported action, or add the Undo button back to the Quick Access Toolbar if it is missing. The Undo command is available while you work in a workbook, but it cannot reverse every operation and its history does not carry over after you close the workbook.
The steps below are for Microsoft Excel for Microsoft 365 on Windows. They cover both ways to access Undo, explain how to undo several actions, and show what to check if Undo is greyed out or does not restore the result you expected.
What You’ll Need
- Excel for Microsoft 365 on Windows and a workbook open in the desktop app.
- A change in the current Excel session that you want to reverse. If you only want the toolbar button, you can add it before making a change.
Step-by-Step
- Make or identify the change you want to reverse. Undo applies to the most recent action Excel can reverse in the current session. For example, after entering a value in a cell and pressing Enter, Undo can remove that entry. If you are still typing inside a cell or the formula bar, finish the edit with Enter or cancel it with Esc before using the toolbar. This helps distinguish cancelling an unfinished edit from undoing a completed action.
- Use the Windows keyboard shortcut. Press
Ctrl+Zonce to undo the latest supported action. Check the worksheet before pressing it again: each press reverses another action in the available history. If you use a keyboard that has a separate Ctrl key and the letter Z, press them together; do not type the characters one after another. The shortcut is usually the quickest option even when the Undo icon is not visible. - Look for the Undo button on the Quick Access Toolbar. It is usually near the top-left of the Excel window, above or alongside the ribbon. The icon is a curved arrow pointing left. Select it once to undo one action. If the button is visible but grey, Excel has no available action to undo at that moment, or the last operation cannot be reversed.
- Add Undo to the toolbar if it is missing. In Excel for Windows, select File > Options, then select Quick Access Toolbar in the Excel Options window. In the list labelled Choose commands from, select a category that contains Undo, such as Popular Commands or All Commands. Select Undo in the command list and choose Add >>. If the right-hand list shows the new command, select OK to apply the change. The Undo icon should then appear on the Quick Access Toolbar.
- Use the arrow beside Undo to review available actions. When the Undo button has a small drop-down arrow, select the arrow to open the action list. Excel labels the recent actions that can be undone. Select the last action you want reversed; Excel also undoes the actions listed above it, because the history is sequential. For instance, if you select an earlier formatting action, later entries in the list are undone too. Review the list carefully before choosing a group of actions.
- Check the result and redo only if needed. After undoing, inspect the relevant cells, formulas, or formatting. If you removed an action by mistake, use
Ctrl+Yon Windows or select the Redo button, usually a curved arrow pointing right. Redo is available only after an undo and may become unavailable once you make a new change. Do not keep pressing Undo or Redo without checking what Excel is changing.
On a Mac, the equivalent shortcut is Command+Z. If you need to restore the toolbar command, Excel for Mac provides toolbar customization through Excel > Settings or Excel > Preferences, depending on the release, then Ribbon & Toolbar. Look for the Quick Access Toolbar customization options and add Undo if it is available in your version. Excel for the web also supports Undo, commonly with Ctrl+Z on Windows and Command+Z on Mac, as well as an Undo control in its interface. The exact toolbar layout can differ from the desktop app.
Common Mistakes
- Looking for an Undo-on setting. Excel does not have a general switch that enables or disables ordinary Undo. If you cannot see the icon, customize the Quick Access Toolbar or use the keyboard shortcut. If the command is unavailable, investigate the action or workbook state rather than searching for an enable setting.
- Expecting one press to reverse a whole sequence. A single Undo normally reverses one action. A paste, a format change, and a later cell entry can be separate actions. Use the drop-down history to see the sequence, and remember that selecting an older item also reverses the newer listed actions.
- Assuming every Excel action is reversible. Some actions cannot be undone, and running a VBA macro typically clears the ordinary Undo history. Actions performed by certain add-ins or external processes can also affect the history. Undo is not a substitute for keeping a backup of important data.
- Closing Excel and expecting the same history later. Undo history is temporary. Once you close the workbook, you should not expect to reopen it and undo an earlier session’s edits. Saving is useful for preserving the current file, but it does not create a permanent, browsable Undo history.
- Confusing Undo with cancelling an in-progress edit. If you are still editing a cell, pressing Esc cancels the current, uncommitted edit. Undo instead reverses completed actions in the worksheet. Use Enter to commit an edit, or Esc to abandon it, before deciding whether you need Undo.
Tips
- Keep the toolbar easy to reach. The Quick Access Toolbar can be displayed above or below the ribbon in desktop Excel. If you add Undo but cannot find it, look near both positions or use the toolbar’s customization menu. The keyboard shortcut remains available even if you move the toolbar.
- Use the Undo list for a controlled rollback. The list is useful when you know roughly when the unwanted change happened. Read the action names and select the point you want to return to; Excel will remove that action and everything after it in the undo sequence. This can reverse more than intended if you choose too far back.
- Save a copy before risky edits. Before a broad replacement, complex import, or operation you are unsure about, save the workbook or create a separate copy. A copy gives you a recovery option if the action cannot be undone or the history is cleared. Undo is best for immediate corrections, not long-term version management.
- Check formulas as well as displayed values. If an undo changes a formula cell, select the cell and inspect the formula bar. A displayed result may look plausible even after a formula was replaced with a fixed value. For important models, confirm that both the cell contents and the surrounding calculations are still correct.
- Use Redo deliberately. Redo restores an action you just undid; it is not a general way to recover an old version. If you perform a new edit after undoing, the previous redo sequence may be discarded. Check the sheet before making another change if you may want to redo.
Troubleshooting
The Undo button is missing. Press Ctrl+Z first to check whether Undo itself works. If it does, add the command through File > Options > Quick Access Toolbar, select Undo from the command list, choose Add >>, and confirm with OK. If the command list is filtered, switch to All Commands and locate Undo alphabetically.
Undo is greyed out or Ctrl+Z has no effect. Excel may have no undoable action in the current session, or the last operation may not support Undo. Make a small, ordinary test change in a noncritical cell and press Ctrl+Z to check whether the shortcut works. If that test does undo correctly, the original action is likely outside the available history or not reversible. Do not use a valuable cell for the test, and remove any test entry afterward.
Undo reverses more than expected. Stop and inspect the workbook before proceeding. The drop-down list can undo a run of later actions when you select an earlier one. If you have only just undone and have not made a new edit, use Redo or Ctrl+Y to restore the action. If you are uncertain, save a separate copy before attempting further recovery.
The command vanished after a macro or another tool ran. Excel’s standard Undo history is not a guaranteed recovery mechanism for macros; running VBA generally clears it. Some add-ins and connected operations may also change what is available. If the action cannot be undone, check for a saved copy, your organization’s version history, or a backup. Do not rerun an unfamiliar macro as a way to restore the previous state.
The shortcut behaves differently in the browser or on Mac. Confirm that the workbook is active and that you are using the shortcut for your operating system: Ctrl+Z on Windows, Command+Z on Mac. Excel for the web may place controls differently from the Windows desktop app. If a shortcut is intercepted by the browser or another application, use the Undo control in Excel’s toolbar instead.
Frequently Asked Questions
Can I enable Undo in Excel if it has been turned off?
There is no general Undo switch for normal worksheet editing. Undo is built in. If the toolbar icon is hidden, add it through Quick Access Toolbar options; if a particular action cannot be undone, the command may be unavailable for that action.
What is the Undo shortcut in Excel?
On Windows, press Ctrl+Z. On a Mac, press Command+Z. Excel for the web generally uses the same operating-system shortcuts, though you can also use its on-screen Undo control.
How many times can I undo in Excel?
There is not one fixed number that applies to every workbook and session. Excel keeps a temporary sequence of supported actions, and the available list can vary with the work being done. Use the Undo drop-down to see what is currently available rather than relying on a particular count.
Does saving the workbook remove the Undo history?
Saving does not create a permanent Undo history, and you should not rely on it to preserve one. Undo is intended for the current working session; after closing the workbook, earlier actions generally cannot be undone by reopening it.
Can I undo a macro in Excel?
Usually not with Excel’s regular Undo command. Running a VBA macro typically clears the standard undo history, and macros do not automatically provide their own reversal feature. Save a separate copy before running a macro if you may need to return to the original workbook.
Why does Undo not reverse a change I just made?
The operation may not support Undo, the history may have been cleared, or the change may have come from a macro, add-in, or external process. Check the Undo list. If the action is not listed, look for a backup or version history rather than repeatedly pressing the shortcut.
Related
- How to Delete Grouping in Excel: Rows, Columns & Sheets
- How to Delete Gaps in Excel: Remove Blank Cells and Rows
- How to Delete Gridlines in Excel Without Hiding Cell Borders
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Insert a Check Box in Word 365 and Make It ClickableTo insert a clickable check box in Word 365, turn on the Developer tab, then choose Developer >…
- Excel Data Validation Allow List: Create and Manage OneYes. In Excel for Microsoft 365 on Windows, create an allow list by selecting the cells, choosing Data…
- Create a Slicer in Excel: Setup, Filtering, and TipsTo create a slicer in Excel for Microsoft 365 on Windows, select a cell in an Excel table…
- How Replace Works in Excel: Find and ReplaceIn Excel, “replace” can mean the REPLACE function, which swaps characters at a specified position in text, or…
- Combine in Excel: Text, Cells, and DataYou can combine text in Excel with the ampersand operator (&), CONCAT, or TEXTJOIN; for example, with a…
- How to Mail Merge in Word 365: A Step-by-Step GuideTo mail merge in Word 365, create or open a recipient list, choose a merge type from the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.