VBA & automation

How to Record a Macro in Excel (Step-by-Step Guide)

Updated June 30, 2026 5 min read

The Macro Recorder is the easiest way to automate Excel without writing a line of code. You press record, do the task once by hand, and Excel watches every click and keystroke, then turns it into a reusable VBA macro you can replay any time.

It is perfect for repetitive jobs like formatting a report, applying filters, or cleaning a column the same way every week. This guide shows you how to record, run, and tidy up a macro, plus how to read the code it produces so you can tweak it later.

Examples

Real, copy-paste-ready formulas.

1. Start the Macro Recorder

You describe Where do I begin recording a macro?
View > Macros > Record Macro

Open the Macros dropdown on the View tab (or the Developer tab) and click Record Macro. Give it a name, an optional shortcut key, and choose where to store it, then click OK to start capturing your actions.

2. What the recorder produces

You describe I recorded making row 1 bold. What does the code look like?
Sub FormatHeader() Rows(1).Font.Bold = True End Sub

Each action becomes a line of VBA inside a Sub. Recording first and reading the result is a great way to learn the syntax, because Excel writes the exact code for the task you just performed.

3. Run a recorded macro

You describe How do I replay the macro I just recorded?
Alt + F8 (View > Macros > View Macros)

Press Alt + F8 to open the Macro dialog, select your macro, and click Run. If you assigned a shortcut while recording, you can also trigger it with that key combo instantly.

How to write Macro Recorder step by step

  1. 1

    Go to the View tab, click the Macros dropdown, and choose Record Macro (or use the Developer tab if you have it enabled).

  2. 2

    Name the macro, optionally set a shortcut key and a description, choose This Workbook as the storage location, then click OK.

  3. 3

    Perform the task exactly as you want it automated; every action you take is now being recorded.

  4. 4

    When finished, return to View > Macros and click Stop Recording (the same menu where you started).

  5. 5

    Save the file as a macro-enabled workbook (.xlsm) so the recording is kept.

  6. 6

    Replay it any time with Alt + F8, or open the Visual Basic editor with Alt + F11 to read and fine-tune the generated VBA.

Frequently asked questions

Where is the Record Macro button in Excel?

It lives under View > Macros > Record Macro. It also appears on the Developer tab, which you can turn on via File > Options > Customize Ribbon by checking Developer.

Should I use absolute or relative references when recording?

By default the recorder uses absolute references, so it acts on the same cells every time. Click Use Relative References before recording if you want the macro to act relative to wherever you start, such as the active cell.

Why does my recorded macro not work on other sheets?

The recorder often hard-codes specific sheet names and cell addresses. Open the macro in the VBA editor (Alt + F11) and replace fixed references with ActiveSheet or a chosen Range so it runs anywhere.

Can the recorder capture everything?

No. It records most cell and formatting actions but cannot capture logic like loops, conditions, or message boxes. For those you write or generate VBA. ExcelPerfect can turn a plain-English description into that code for you.

Launching soon

Get this the moment we launch

ExcelPerfect turns plain English into the exact formula, and it’s almost here. Join the waitlist for early access and an extended free trial.

You type Turn my recorded macro into VBA that loops over every worksheet
View > Macros > Record Macro

No spam, ever. Just one email the day we launch. By joining you agree to our Privacy Policy.