Excel Macro Recorder With Hotkeys: Setup and Tips

VBA & macros · Updated November 11, 2026

Yes. In Excel for Microsoft 365 on Windows, open View > Macros > Record Macro, enter a name, and type a letter in the Shortcut key box; Excel assigns Ctrl+that letter to run the macro. Perform the actions you want to automate, then choose View > Macros > Stop Recording. You can also assign or change a shortcut for an existing macro through Alt+F8 and Options.

What a macro recorder and hotkey do

Excel’s macro recorder captures many actions you perform in the workbook and saves them as a VBA macro. A hotkey is simply a keyboard shortcut that launches that saved macro. The shortcut does not record your keystrokes as a separate command, and it does not make the macro more intelligent: it is a convenient way to run the recorded sequence without opening the macro list each time.

This is useful for repeatable work such as applying a standard format, preparing a report, clearing a known input range, or arranging a worksheet for printing. For example, you might record selecting a report range, applying a number format, making the header bold, and setting a print orientation. Pressing the assigned shortcut runs those recorded steps again.

The recorder is best suited to actions that are predictable and similar each time. It generally records what you do, not the reason you did it. A macro recorded while a particular cell is selected may later affect the wrong place if it relies on that selection. Understanding this limitation helps you decide whether recording is enough or whether the macro needs editing or a different approach.

Record a macro and assign its hotkey

  1. Save the workbook in a macro-enabled format if the macro needs to remain in that file. Choose Excel Macro-Enabled Workbook (*.xlsm) in Save As.
  2. Open View > Macros > Record Macro. The Developer tab also has a Record Macro command if that tab is available.
  3. Enter a name that starts with a letter and contains no spaces. Use the Shortcut key box to enter a letter. Excel shows the resulting Ctrl+letter shortcut.
  4. Choose where to store the macro. This Workbook keeps it with the current file; Personal Macro Workbook makes it available in Excel whenever that personal workbook is loaded.
  5. Optionally enter a description, then select OK. From this point, Excel records supported actions.
  6. Carry out the steps in the intended order, taking care not to click around unnecessarily. When finished, choose View > Macros > Stop Recording, or use the Stop Recording control if it is visible.

Before recording, decide what the macro should do when the starting selection is different. If the sequence should always act on the same named range or known cells, plan for that rather than assuming the right cell will happen to be active. Try the macro on a copy of the workbook before relying on it in routine work.

Assign or change a shortcut later

You do not have to decide on a hotkey before recording. Press Alt+F8 to open the Macro dialog, select the macro, and choose Options. In the Macro Options dialog, set or change its shortcut key and confirm. The same dialog can hold a description. If a macro is stored in another workbook, that workbook generally needs to be open for its macro to be available.

Excel’s recorder shortcut field takes a letter, not an arbitrary combination such as Ctrl+Alt+M. A lowercase letter produces Ctrl+letter; an uppercase letter produces Ctrl+Shift+letter. For example, entering an uppercase M assigns Ctrl+Shift+M. Choose a shortcut deliberately, because it can replace a shortcut Excel or another add-in already uses while the workbook containing the macro is open.

On a Mac, the ribbon and keyboard conventions differ from Windows. Use Excel’s macro-recording controls and the shortcut field offered in the recording or macro-options dialog; do not assume a Windows Ctrl combination will behave the same way on macOS. Option+F8 is commonly used to open the Macro dialog on Mac, though function-key settings may require Fn as well. Check the shortcut displayed by your Excel version and avoid assigning one that conflicts with a system or application command.

Absolute and relative recording

One important recorder setting determines whether actions are tied to fixed addresses or to the active cell. With relative references off, selecting a particular cell during recording can make the macro return to that same address each time. This is suitable for a task that always acts on a fixed location, but inconvenient when the task should begin wherever the user currently is.

With relative references on, recorded movement is expressed in relation to the current selection. To toggle the setting in Excel for Windows, use View > Macros > Use Relative References before starting the recording; the command is also available on the Developer tab when shown. For instance, a macro that moves one cell down and applies a format can then work from different starting cells. Relative recording does not automatically make every action adaptable: a recorded selection, fixed range, or worksheet name can still constrain the macro.

Test both the expected starting point and a different one. If a macro behaves unexpectedly, inspect the recorded code with Alt+F11. Recorder-generated VBA often includes selection and activation steps. A person familiar with VBA can sometimes simplify these steps or make the target range explicit, but editing code requires care and is not necessary for every recorded task.

Choose where the macro is stored

  • This Workbook: The macro travels with the current macro-enabled workbook. This is usually appropriate when the automation belongs to one file or should be shared with that file.
  • Personal Macro Workbook: Excel stores the macro in a hidden workbook named PERSONAL.XLSB, which is loaded for the current user when Excel starts. This is convenient for personal utilities used across many workbooks, but it is not automatically included when you send someone a separate workbook.
  • New Workbook: Excel creates a separate workbook to hold the macro. Use this when you intentionally want the recorded macro in a new file rather than the current one.

A macro stored in the Personal Macro Workbook can use a hotkey across workbooks, but its shortcut may be active whenever that workbook is loaded. Document personal shortcuts so you can remember what they do, and do not assume another person will have the same macro or shortcut.

Workbook formats, security, and safe use

A standard .xlsx workbook cannot store VBA macros. If you save a recorded macro in a file that must retain it, use .xlsm, or use another macro-capable format such as .xlsb where appropriate. Excel may warn that macro features will be lost if you save a macro-enabled file as .xlsx. Keep the original or choose a macro-capable format before closing.

Macros can change or delete data, and Excel does not provide the normal Ctrl+Z undo history for actions performed by a VBA macro. Save a copy of the workbook before running an unfamiliar or destructive macro. If a shortcut seems to do nothing, Excel may have disabled macros under its security settings, the workbook may not be open, or the macro may be stored in a different file.

Only enable macros from sources you trust. A workbook can contain code that does more than the visible recorded formatting steps, so a familiar filename is not proof that its macros are safe. In workplace settings, organizational policies may control which macros can run. Avoid lowering security settings globally just to make one file work; ask the file’s provider or your administrator about a trusted, approved way to use it.

Common hotkey problems and fixes

  • The shortcut runs the wrong command: The assigned key may conflict with a built-in Excel shortcut or an add-in. Change the macro’s shortcut through Alt+F8 > Options, or choose a less common letter combination supported by the dialog.
  • The macro starts in the wrong place: It may have been recorded with absolute references or may contain a fixed selection. Rerecord with relative references if the operation should follow the active cell, or revise the code if the destination should be explicit.
  • The macro is missing: Check the Macro dialog’s list and the workbook selected under Macros in. A macro saved in another workbook or in PERSONAL.XLSB may not be included in the current file.
  • Excel blocks the macro: Confirm the file is in a macro-capable format and follow your organization’s security requirements. Do not enable code from an untrusted source simply because a hotkey was assigned.
  • The recorded sequence is unreliable: The recorder may have captured extra clicks, selections, or worksheet changes. Record a shorter sequence, use relative references where appropriate, and test with representative data.

When to use a recorder, VBA, or another tool

The recorder is a good starting point when the job consists of a repeatable sequence of ordinary Excel actions and you want a quick shortcut to run it. It also provides a practical way to see how Excel translates actions into VBA. However, it is not a general-purpose workflow designer. A recorded macro may not know how to identify a changing last row, handle missing data, ask a user a question, or choose among different cases unless those behaviors are added deliberately.

For a small fixed routine, recording and assigning a hotkey may be simpler than writing code. For a process with conditions, variable-sized data, error handling, or several users, a carefully written and documented VBA procedure may be more dependable. Power Query is often a better fit for repeatable importing and transformation of data, while built-in Excel features such as tables, filters, and conditional formatting may eliminate the need for automation altogether. If a macro is shared, explain its purpose, required starting conditions, and shortcut in the workbook documentation.

Frequently Asked Questions

Can I assign a hotkey to a macro after recording it?
Yes. Press Alt+F8, select the macro, choose Options, and set the shortcut key. On Mac, open the Macro dialog using the shortcut available in your Excel setup, then use its options; the modifier keys differ from Windows.

Can an Excel macro hotkey use Ctrl+Shift?
Yes. In the shortcut field, enter an uppercase letter to assign Ctrl+Shift+that letter on Windows. A lowercase letter assigns Ctrl+that letter. Check for conflicts with shortcuts already used by Excel or add-ins.

Will the hotkey work in every workbook?
Only if the macro is available in the open Excel session. A macro saved in the current workbook is available when that workbook is open. A macro in PERSONAL.XLSB can be available across workbooks for that Excel user, but it is not automatically shared with other people.

Why does my recorded macro affect the wrong cells?
The recording may use fixed cell addresses, or it may rely on the selection that was active when the macro began. Try recording with Use Relative References if the task should follow the active cell, and test the macro from more than one starting position.

Can I undo a macro with Ctrl+Z?
No. Excel’s ordinary undo history does not apply to VBA macro actions. Save a backup before running a macro that changes data, especially if its code or behavior is unfamiliar.

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.