Step-by-Step Guide: How to Record Macros in Excel

Excel Macros
Aug 28, 2025 6 min read
How to Record Macros in Excel

If you’re anything like me, you want to spend less time repeating tasks and more time thinking, analyzing, and creating. That’s exactly why learning how to record macros in Excel will change everything for you! In this guide, we’ll walk through the process together, step by step, so by the end, you'll be able to automate those boring chores and make Excel work for you.

What Are Macros, and Should We Even Care?

Let’s start from the top. An Excel macro is sort of like a personal assistant who remembers every click and keystroke you make, then does all of it on command — instantly. We use macros to capture routine processes like formatting, calculations, and repetitive data entry so that we don’t have to redo them ever again.

Imagine having to bold the header row, centre the text, and change the background color for ten spreadsheets every month. That used to take me ages — until I discovered the magic of recording macros.

Getting Ready: Show the Developer Tab

Before we rush in, I want you to make sure you can see the Developer tab at the top of your Excel screen, because that’s where all the macro action happens.

  1. Click File, then Options.
  2. Go to Customize Ribbon.
  3. Find the Developer option on the right, check the box, and hit OK.
Show the Developer Tab in Excel

Let’s Record Our First Macro

Now we’re ready to record some magic! Here's how we do it — and trust me, it really is simple once you try it.

1. Click “Record Macro”

You’ll find this button in the Developer tab, usually in the Code section near the top left. You can also find it under “View” if you’re more comfortable there.

Record Macro in Excel

2. Set Up the Macro Details

A dialog box appears where you can personalize your macro as per your convenience.

  • Macro Name: Pick a name that makes sense. I like something like FormatHeaders — no spaces!
  • Shortcut Key: Do you want to run your macro with a keyboard combo? You can set one here, but try not to overwrite Excel’s built-in shortcuts.
  • Store Macro In: Most times, I save in “This Workbook,” but if you want your macro everywhere, choose “Personal Macro Workbook.”
  • Description: Jot down what the macro does. Trust me, if you build a lot of macros, you’ll thank yourself later.
Record Macro in Excel

3. Record Your Actions

Let’s do a real example by formatting the top row, which is the header in this. Go ahead and do the steps Excel should remember:

  • Select your header cells (let’s say row 1).
  • Bold the text.
  • Center the alignment.
  • Change the fill color to your favorite.

Everything you do right now is being recorded. Don’t worry about perfection — you can always try again. Mistakes help us learn!

Record Macro in Excel

4. Stop Recording

Once you finish all the actions, head back to the Developer tab and click “Stop Recording.” There’s also a small square icon at the bottom left of your Excel window (kind of like a tape recorder’s stop button) — give that a click. And that’s it!

Stop Recording Macro in Excel

Testing and Using Your Macro

Okay, we’ve recorded the macro — but how do we use it? Here’s how we put it to work:

  1. Highlight some new header cells in any worksheet.
  2. Go to Developer > Macros. You will find all the macros you have built, and you can choose the one you just built, then hit Run.
  3. Or, if you gave it a shortcut, just press that combo!

Suddenly, you’ll see Excel work its formatting magic. If anything looks off, don’t worry — just re-record the macro or edit it later. Nobody gets it perfect on the first go, not even me.

Using "Relative References" for More Power

Here’s a secret pros use: Before you start recording, click “Use Relative References” in the Developer tab. This makes your macro apply changes to wherever you have your cursor, not a fixed cell. That means you can reuse your macro across different sheets and ranges, and it’ll always work the way you want.

Using Relative References in Macros

A Second Example: Automating Calculations

Let’s say you want to automate creating sums for columns of numbers. Repeat the macro recording process:

  • Select the cell below a data list.
  • Type =SUM(A2:A10), press Enter.
  • Stop recording.

Now, every time you run your macro at the end of a list, Excel calculates the sum for you — no fuss, no formulas, no stress.

Automating Calculations using Macros

Where Macros are Saved and How to Edit Them

Macros live in whichever workbook you chose (or your Personal Macro Workbook if you set it that way). If you’re curious, you can view and tweak the code:

  • Go to Developer > Macros, select your saved macro, and click Edit.
  • This opens up the Visual Basic Editor, where you’ll see the steps you’ve recorded.
  • Feel free to experiment in here as you get braver. (Just make a backup first!)

We have already covered how to see saved macros in "Testing and Using Your Macro".

Where Macros are Saved and How to Edit Them

Common Problems (and How We Fix Them)

Sometimes macros don’t work perfectly. Let’s talk about what might go wrong and how we fix it together:

  • Macros not running: Make sure you’ve enabled macros (Excel prefers safety first).
  • Keyboard shortcuts conflicting: Choose a unique combo!
  • Macro applies to wrong cells: Did you use absolute instead of relative references? Try again with “Use Relative References” on.
  • Can’t save the file: To keep your macros, save as .xlsm.

Pro Tips for Macro Success

I’ve learned a few tricks along the way:

  • Keep macro names simple and clear.
  • Always write a description. You’ll love your future self for this!
  • Always run macros on practice data before using them on actual data.

Download Practice file

Wrapping Up

You and I just went from curious beginners to confident macro recorders in Excel! Now we don’t have to waste time on the same old formatting and calculations — with a simple click or keyboard combo, Excel does it for us. Try creating a macro for whatever bugged you most this week and you’ll see why I never work in Excel without macros anymore.

Let’s make Excel work for us, not the other way around. If you have a favorite macro or if you run into a tricky step, leave a comment below — I always love hearing how you solve problems and sharing what works in real life!

Comments (0)

Leave a Comment

Comments are moderated before publishing.

No comments yet. Be the first to comment!

Quick Tip

Press Ctrl+1 to open Format Cells dialog for any selected range.