Undo, redo and repeat shortcuts in Excel
The keys
| Shortcut | Windows | Mac |
|---|---|---|
| Undo the last action | Ctrl+Z | Command+Z or Control+Z |
| RedoOn Windows, Ctrl+Y repeats your last action when there is nothing to redo. | Ctrl+Y | Command+Y or Control+Y or Command+Shift+Z |
| Repeat the last action, such as inserting a row or applying a formatMicrosoft's Mac list has no Repeat key: Cmd+Y is Redo there. Inside a formula, F4 switches $ signs instead. | F4 or Ctrl+Y | —No Mac shortcut in Microsoft's list |
Checked against Microsoft's official lists on . Where Microsoft lists a key for one platform only, the other column says so instead of guessing.
Repeat: the hidden time-saver
After you do something once, select the next place and press F4. It repeats the last action there: insert a row, delete a column, apply a border or a fill color. To color ten scattered cells, color one with the ribbon, then click each of the others and press F4.
Repeat works for one action at a time, and not for everything; if F4 does nothing, that action cannot be repeated. Microsoft's Mac list has no Repeat key.
How far back undo goes
- Excel keeps about 100 undo steps, and the list is cleared when you close the workbook.
- Running a macro clears the undo list. Save a copy before you run one on important data.
- Some actions, such as deleting a sheet, cannot be undone. Excel warns you before.
When Ctrl+Z does nothing
- You are editing a cell. The first Ctrl+Z undoes typing inside the cell; press Esc to cancel the whole entry instead.
- A macro ran, so the undo list is empty.
Why a shortcut sometimes does nothing
Laptop function keys
On many laptops the top row changes volume or brightness first, so F2 or F4 does nothing in Excel. Hold Fn with the key (Fn+F4), or turn on the laptop's function-key lock. On many Windows laptops that lock is Fn+Esc, but it varies by brand, so look for a small padlock or "Fn" icon on the Esc key.
F4 vs Cmd+T on a Mac
On Windows, F4 has two jobs: while you edit a formula it switches a reference between A1, $A$1, A$1 and $A1, and the rest of the time it repeats your last action. On a Mac, Command+T and F4 both switch the reference, but Command+T creates a table when you are not editing a formula. On a Mac laptop F4 may need Fn.
Related shortcuts
| Shortcut | Windows | Mac |
|---|---|---|
| Switch a reference between A1, $A$1, A$1 and $A1 How to: Absolute reference shortcut in Excel (F4 and Cmd+T) Put the cursor on a reference while editing a formula. Outside a formula, F4 on Windows repeats your last action. | F4 | Command+T or F4 |
| Insert cells, rows or columns How to: Insert row shortcut in Excel Select whole rows (Shift+Space) or columns (Ctrl+Space) first and they go in straight away; otherwise the Insert dialog asks which way to shift. | Ctrl+Shift+PlusWeb Ctrl+Plus | Control+Shift+= |
| Save the workbook | Ctrl+S | Command+S or Control+S |
FAQ
What is the redo shortcut in Excel?
Ctrl+Y on Windows and the web. On a Mac, Cmd+Y or Cmd+Shift+Z.
What does F4 do in Excel?
Outside a formula, F4 on Windows repeats your last action. While you edit a formula, it switches the reference under the cursor between relative and absolute.
Can I undo after saving?
Yes, as long as the workbook is still open. Once it is closed, the undo list is gone; use Version History if the file is on OneDrive or SharePoint.
Related guides
In the glossary: Macro