When organizing tables in Excel, you often need to apply the exact same formatting or insert blank rows multiple times. Clicking through top menus repeatedly strains your wrist and slows down your work. How can you repeat your last action instantly with a single keystroke?
Quick Summary
- Repeat last action shortcut:
F4orCtrl + Yon Windows;⌘ + Yon macOS- F4 during formula editing: Cycles through relative (A1) and absolute ($A$1) references
- If it doesn’t work on a laptop: Press
Fn + F4together or useFn + Escto unlock function keys- How it works: Repeats only the single most recent action (certain features like hyperlinks excluded)
How the F4 Shortcut Works to Cut Down Mouse Clicks

To rerun your previous command in Excel, press F4 or Ctrl + Y on your keyboard. It works just like inking a stamp once and pressing it repeatedly across a sheet of paper.
You can use it for many different tasks. Fill a cell with a background color, draw a border, or make text bold, then select another cell and press F4 to apply that exact formatting immediately. Beyond formatting, single actions like inserting or deleting rows and columns or pasting can also be repeated.
Keep in mind that F4 only remembers the single most recent action. If you apply a color and then type text into a cell, the stored action gets overwritten by text input, meaning you can no longer repeat the color formatting. Note that phrases like “repeat in 1 second” are figures of speech describing fast workflow, not an official benchmark.
Related Reading
How to Mask Data in Excel Instantly Without Formulas
How to Fill Blank Cells in Excel All at Once Using Shortcuts
Shortcuts by Operating System and How to Fix Unresponsive Keys

Shortcut combinations may vary depending on your operating system and keyboard settings. Here is how default shortcuts compare between Windows and macOS.
| Category | Windows Shortcut | macOS Shortcut | Description |
|---|---|---|---|
| Repeat Last Action | F4 or Ctrl + Y | ⌘ + Y | Reapplies the last single command like formatting, borders, or row insertion |
| Toggle Formula Reference | F4 (while editing formula) | Command + T or F4 | Cycles between absolute reference ($A$1) and relative reference (A1) |
| Undo | Ctrl + Z | ⌘ + Z | Undoes the previous action (stores up to 100 actions) |
If pressing F4 alone does not work on a laptop keyboard, check your function key lock status. Press Fn + F4 together, or press Fn + Esc to toggle Fn Lock on, and the key will work normally.
If you prefer clicking with a mouse, go to [Customize Quick Access Toolbar] → [More Commands] and add the hidden “Repeat” command to use it directly from the top toolbar.
Other Functions of the F4 Key and Unsupported Exceptions

The F4 key works differently depending on whether you have a cell selected or are editing a formula. Pressing F4 while typing a formula inside a cell or in the formula bar changes how the cell address is referenced.
Each press cycles through Relative reference (A1) → Row-locked mixed reference (A$1) → Column-locked mixed reference ($A1) → Absolute reference ($A$1). This eliminates the need to manually type $ signs when building formulas, saving significant time.
There are also limitations to keep in mind. Certain actions, such as inserting hyperlinks, cannot be repeated using F4. Microsoft’s official technical documentation does not provide an exhaustive list of all non-repeatable actions, so it is best utilized primarily for formatting and standard editing tasks.
Open Excel now, fill any cell with a background color, select another cell, and press F4 to try it right away.
Related Articles
- How to Add Hyphens to Phone Numbers in Excel Without Formulas
- How to Remove Duplicates in Excel Without Losing Data
- How to Recover Unsaved Excel Files After Clicking ‘Don’t Save’
- How to Repeat Header Rows on Every Page When Printing in Excel
