Excel Macro Recorder: Keyboard Shortcuts and Setup

VBA & macros · Updated November 3, 2026

Excel Macro Recorder: Keyboard Shortcuts and Setup

Yes. In Excel for Microsoft 365 on Windows, record a macro from Developer > Code > Record Macro and, in the dialog, enter a letter in Shortcut key if you want a shortcut to run it later. A lowercase letter assigns Ctrl+letter; an uppercase letter assigns Ctrl+Shift+letter. Excel does not have one universal default keyboard shortcut for starting the recorder.

What a macro recorder with keyboard shortcuts means

Excel’s macro recorder turns many actions you perform in a workbook into Visual Basic for Applications (VBA) instructions. Once recorded, those instructions can be run again from the Macros dialog, a button, or a keyboard shortcut. This is useful for repetitive, predictable work: applying the same formatting to a report, preparing a worksheet for printing, or cleaning up a consistent imported layout.

The shortcut is assigned to the recorded macro, not to the act of recording. You can start and stop recording with ribbon commands, then run the finished macro with its assigned shortcut. If you want to use the recorder without a shortcut, leave the Shortcut key box blank; the macro remains available through Excel’s macro tools.

A macro is not simply an Excel formula or a saved sequence of mouse coordinates. The recorder creates VBA code based on supported Excel actions. That code may refer to particular cells, ranges, worksheets, and workbook objects, so the same recorded sequence may not suit every file or every starting position.

Record a macro and assign its shortcut

  1. Open the workbook in desktop Excel and choose Developer > Code > Record Macro. If the Developer tab is hidden on Windows, enable it through File > Options > Customize Ribbon, then select Developer under Main Tabs.
  2. Enter a descriptive name. Macro names cannot contain spaces, and they must follow VBA naming rules; starting with a letter and using underscores between words is a practical convention, such as Format_Monthly_Report.
  3. Optionally enter a letter in Shortcut key. A lowercase letter means Ctrl+letter; an uppercase letter means Ctrl+Shift+letter. Avoid a shortcut you depend on for a built-in Excel command.
  4. Choose where Excel should store the macro. This Workbook keeps it with the current file; Personal Macro Workbook makes it available when you open Excel; New Workbook stores it in a separate workbook.
  5. Choose OK, perform the worksheet actions you want to repeat, and then select Developer > Code > Stop Recording. Stop as soon as the intended sequence is complete, because extra clicks and edits may also be recorded.

For example, you could record selecting a report range, applying a number format, making the header bold, and setting a print orientation. If the range is always in the same place, fixed references may be appropriate. If the action should apply to the cells beside the active cell, use relative references instead.

Choose between relative and fixed cell references

One of the most important recorder settings is Use Relative References, available on the Developer tab in the Code group. With relative references turned off, the recording generally targets the same locations you worked on during recording. With the setting turned on, recorded cell actions are relative to the active cell, which can make a macro reusable across rows or columns.

Suppose a repeated task formats the three cells to the right of whichever cell is active. Starting in A2 and selecting B2:D2 while relative references are off can leave the macro targeting B2:D2 every time. If relative references are on while recording, the selection can instead be understood as a move from the starting position. Running it from A3 can then act on B3:D3. The precise result depends on the actions recorded, so test the macro on a copy and from more than one starting cell.

Set the relative-reference option before you begin recording. Changing it afterward does not rewrite the actions already captured. For macros that should always act on a named sheet or a specific table, fixed references may be clearer; for a repeated action on the current row or selection, relative behavior may be a better fit.

What the recorder captures—and what it does not

The recorder is designed to capture many actions made within Excel, such as entering data, selecting cells, formatting, sorting, and using supported ribbon commands. It records actions as VBA operations rather than preserving a video of your screen. As a result, two different ways of reaching the same result may create different code, and a recording can include unnecessary selections or navigation steps.

It is not a general-purpose recorder for every computer task. It does not automate arbitrary actions in other applications just because they happen while recording, and not every Excel feature or interface interaction is recordable. Dialogs, add-ins, workbook structure, and actions dependent on external tools may require a different approach. A macro can also fail if it expects a particular sheet, range, or workbook state that is absent when it runs.

A common misconception is that the recorder will intelligently infer the user’s goal. It usually captures the steps, not the intent. If you record copying a value from cell B2 into C2, the result may continue to refer to those specific cells rather than finding the next row of data automatically. Review and test the outcome before relying on it for a recurring process.

Run or change a shortcut after recording

You do not have to choose a shortcut while recording. To add or change one later on Windows, choose Developer > Code > Macros, select the macro, and choose Options. Enter a lowercase or uppercase letter in the shortcut field and confirm. The same Macros dialog can run or delete a selected macro. You can also run one from the list with Alt+F8 in Windows Excel.

Keep shortcuts memorable but uncommon. For instance, Ctrl+Shift+R might be easier to distinguish from everyday commands than Ctrl+C, but check your Excel setup and other add-ins before assigning it. A macro shortcut can interfere with a shortcut you already use, and a shortcut tied to a macro stored in a particular workbook may not be available in the way you expect when that workbook is closed.

On Mac, Excel also provides macro recording and macro-management tools, but keyboard conventions and available combinations differ from Windows. Use the shortcut field and menus shown in your Mac version rather than assuming a Windows assignment will behave identically. VBA that depends on Windows-specific components may also need changes to run on Mac.

Choose where the macro lives and save it safely

If you store a macro in This Workbook, save the file in a macro-capable format such as Excel Macro-Enabled Workbook (*.xlsm). Saving a workbook containing VBA as a standard .xlsx file does not preserve its macros; Excel warns that macro content will be removed if you continue in that format. Keep the macro and the data it operates on together when the task is specific to one file.

The Personal Macro Workbook is useful for general-purpose macros you want available in Excel sessions. Excel keeps this workbook hidden during normal use and loads it when Excel starts. When you create or change a personal macro, save the Personal Macro Workbook when prompted as you exit Excel; otherwise, the change may not be retained. A macro stored there can be available across workbooks, so use clear names and avoid shortcuts that collide with common commands.

Macros can change cells, worksheets, or files, and Excel’s undo history does not reverse a macro run with Ctrl+Z. Before running an unfamiliar or newly edited macro, save a separate copy of the workbook. Only enable macros from sources you trust. If a file arrives with macros disabled, do not enable them solely to get past a warning; confirm where the file came from and why the macro is needed. Organizations may also manage macro settings centrally.

Common problems and practical alternatives

  • The shortcut does nothing: confirm the workbook containing the macro is open, the macro is stored where you expect, and Excel has permitted it to run. Check whether the shortcut conflicts with an Excel command or another macro.
  • The macro changes the wrong cells: check whether Use Relative References was set correctly before recording. Also check the active cell and worksheet at the time you run it.
  • The macro works only in the original workbook: the recorded instructions may refer to that workbook’s sheet names, ranges, or layout. Test with the intended files and revise the macro if their structure varies.
  • The macro disappeared after saving: confirm that the workbook was saved as .xlsm, or that changes to the Personal Macro Workbook were saved when Excel closed.
  • The recording is long or brittle: simplify the actions, remove unneeded recorded steps by editing the VBA if you understand it, or consider a formula, Power Query, or a table-based workflow instead.

For a one-time or occasional transformation, a built-in command may be simpler than a macro. Formulas are often better when results need to update as source data changes. Power Query is designed to import and reshape data through repeatable query steps. A macro is a good candidate when the task involves a stable sequence of Excel actions that is tedious to repeat and does not require complex decisions.

Frequently Asked Questions

Is there a keyboard shortcut to start recording a macro in Excel?
There is no single universal default shortcut for starting the recorder in Excel for Microsoft 365 on Windows. Use Developer > Code > Record Macro. You can assign a keyboard shortcut to the macro so it is quick to run after recording.

Can I assign a shortcut after the macro is recorded?
Yes. Open Developer > Code > Macros, select the macro, choose Options, and set its shortcut. A lowercase letter uses Ctrl+letter, while an uppercase letter uses Ctrl+Shift+letter on Windows.

Does the macro recorder record mouse clicks?
It records supported Excel operations, not a literal replay of mouse movement and screen coordinates. Clicking a ribbon command may result in VBA that performs the corresponding Excel operation, but the recorder does not automate every on-screen interaction.

Can I use a recorded macro on a Mac?
Excel for Mac supports VBA macros, but some Windows-specific code and features may not work on Mac. Keyboard combinations also differ, so check the Mac version’s shortcut options and test the macro in that environment.

Can I undo a macro with Ctrl+Z?
No. Excel’s normal undo stack does not undo a macro’s changes. Save a backup copy before running a macro, especially if it edits or deletes data.

Related

Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.

More in VBA & macros

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.