Record a Macro in Excel: automate a task in 2 minutes

By Srini Vanamala / September 29, 2026 / Macros & VBA
Record a Macro in Excel: automate a task in 2 minutes

A macro is a recording of clicks and keystrokes. Record a task once, replay it with one shortcut. No programming.

What you will make

A macro that formats a heading row: bold, green fill, freeze the top row.

Step 1: show the Developer tab (once)

Right-click the ribbon › Customize the Ribbon › tick Developer › OK.

Step 2: record

  1. Developer › Record Macro.
  2. Name: FormatHeading (no spaces). Shortcut: hold Shift and press F → Ctrl+Shift+F. Store in: This Workbook. OK.
  3. Now do the task: select row 1, press Ctrl+B, pick a fill colour, View › Freeze Top Row.
  4. Developer › Stop Recording.

Step 3: replay

Open another sheet and press Ctrl + Shift + F. The formatting happens instantly.

Step 4: save it properly

File › Save As › file type Excel Macro-Enabled Workbook (.xlsm). A normal .xlsx throws the macro away.

Check it worked

Close and reopen the .xlsm. Click Enable Content on the yellow bar. Developer › Macros should list FormatHeading.

Common mistakes

The macro touched the wrong cells. Recording saves exact addresses (A1). Click Use Relative References on the Developer tab before recording if the task should start wherever the cursor is.

Shortcut clashes. Ctrl+Shift+letter is safe; plain Ctrl+letter overrides Excel’s own shortcuts.

Macros disabled? See how to enable macros.

← →
Srini Vanamala

20 years with spreadsheets and enterprise systems. Writes one short, plain-English Excel lesson a day. Got an Excel question? learnexceleasycom@gmail.com

Have a question about this lesson?

Ask anything — I read every comment. Your email is never shown.