How-to · Excel for Mac

How to record a macro in Excel on Mac: step by step for Microsoft 365

To record a macro in Excel on Mac, first turn on the Developer tab in Excel > Preferences > Ribbon & Toolbar. Then choose Developer > Record Macro, name it, set a one-letter shortcut, do the task, and click Developer > Stop Recording.

Updated Checked against Excel for Microsoft 365, Excel 2024 and Excel 2021 for Mac10 minEasy

Person typing on a laptop at a desk while working on a spreadsheet they want to automate
Repeated spreadsheet work is what a macro handles best. · Image by StartupStockPhotos from Pixabay

Quick answer

  • Turn on the Developer tab in Excel > Preferences > Ribbon & Toolbar, tick Developer under Main Tabs, then click Save.
  • Choose Developer > Record Macro, give it a name with no spaces, and set a one-letter shortcut key.
  • Do the task once, then click Developer > Stop Recording. Save the file as a macro-enabled .xlsm workbook.
  • Run the macro with Option+Command+letter for a lowercase shortcut, or Control+Shift+letter for an uppercase one.

What you need

  • Excel for Mac: Microsoft 365, Excel 2024 or Excel 2021
  • A workbook you can edit on your Mac
  • About 10 minutes and a test copy of your file

How to Record a macro in Excel for Mac in Excel on a Mac

  1. Open Excel Preferences

    ExcelPreferencesRibbon & Toolbar

    Open Excel for Mac and choose Excel > Preferences. Click Ribbon & Toolbar. You will see the list of tabs that Excel shows on the ribbon.

    Tip: Look at the Main Tabs list. The Developer tab sits there, not in the other tab groups.

  2. Tick the Developer tab

    Ribbon & ToolbarMain TabsDeveloper

    Under Main Tabs, tick Developer. Click Save. The Developer tab appears in the ribbon next to the other tabs.

    Tip: If the tab does not show, return to Preferences and check the box once more.

  3. Open the workbook and choose a start cell

    Open the workbook you want to automate. Click the cell where you want the macro to begin. The active cell matters if you use relative references.

    Tip: Use a copy of the file for your first test, not your live workbook.

  4. Turn on Use Relative References (optional)

    DeveloperUse Relative References

    Only turn this on if the macro should work from wherever the active cell is. Turn it on before you click Record Macro. Leave it off to record fixed addresses such as A1:F1.

    Tip: You can record the same steps twice, once each way, and compare the results.

  5. Click Record Macro

    DeveloperRecord Macro

    Click Record Macro on the Developer tab. Microsoft's Mac guide does not list a keyboard shortcut for this button, so use the ribbon.

    Tip: Wait for the Record Macro dialog to open before you do anything else. Anything you click first can be recorded.

  6. Type a macro name

    In Macro name, type a name that starts with a letter. Use letters, numbers or _, with no spaces. Avoid names like FMT1, which look like a cell reference.

    Tip: FormatHeader or Format_Header both work.

  7. Check Store macro in

    Keep This Workbook selected in Store macro in. Microsoft's Mac guide names This Workbook as the storage choice, so the macro saves with this file.

    Tip: If your version shows other choices, confirm the setting in the app before you record.

  8. Set the shortcut key

    In Shortcut key, type one letter, upper or lower case. A lowercase letter runs with Option+Command. An uppercase letter runs with Control+Shift.

    Tip: Pick a letter that Excel does not already use for a shortcut you need.

  9. Add a description and click OK

    Type a short description, such as what the macro changes. Click OK, and Excel starts recording.

    Tip: Write a description that says what the macro changes, so you recognise it later.

  10. Perform the actions once

    Do the task exactly as you want it repeated. Select the cells, type, format or enter formulas. Move slowly and avoid stray clicks, because the recorder keeps them.

    Tip: If you make a mistake, stop and record again from the start. A clean run is easier to trust.

  11. Stop recording

    DeveloperStop Recording

    When the task is done, click Stop Recording on the Developer tab. Excel stops capturing actions, and the macro stays in the workbook.

    Tip: Do not keep working after this step. Anything you do next will not be part of the macro.

  12. Save as a macro-enabled workbook

    FileSave As

    Choose File > Save As. Pick the macro-enabled workbook format, .xlsm, then save. Microsoft's guide on running macros describes this format for workbooks that contain macros.

    Tip: Keep your original file as a backup until the macro works on a copy.

  13. Run the macro with its shortcut

    ⌥⌘letter

    Open the workbook and select the cells you want to change. Press Option+Command and your letter for a lowercase shortcut. For an uppercase shortcut, press Control+Shift and your letter.

    Tip: If nothing happens, check that the workbook is open and that macros are allowed.

  14. Review or edit the macro later

    DeveloperMacros

    Click Macros to see the list. Choose Options to change the shortcut or description. Choose Edit to open the code editor, where F5 runs the macro.

    Tip: Use Step Into with F8 to move through the code one line at a time.

Before you record: versions and what you need

Microsoft's Developer tab guide for Mac covers Excel for Microsoft 365 for Mac, Excel 2024 for Mac and Excel 2021 for Mac. If you use one of those, the steps in this guide match your screen. You need the Excel app on your Mac, with the workbook open in that app and editable.

Recording a macro does not record a video. Excel writes down the actions you take, then replays them when you run the macro. The result is a small block of VBA code saved inside the workbook. You can open that code later, but you do not need to read it to use a basic macro.

Person typing on a laptop at a desk while working on a spreadsheet they want to automate
Repeated spreadsheet work is what a macro handles best. · Image by StartupStockPhotos from Pixabay

Show the Developer tab on your Mac

The Developer tab holds every macro control. Record Macro, Stop Recording, Macros and Use Relative References all sit there. Excel for Mac hides the tab until you turn it on, so start in Preferences. Open Excel > Preferences, choose Ribbon & Toolbar, and tick Developer under Main Tabs. Click Save, then check the ribbon. If the tab still does not appear, quit Excel and open your workbook again.

Worked example: a macro that formats a header row

Say you get a sheet each Monday with column headers in row 1. You bold the headers, fill them grey and centre them. Doing that by hand takes a minute or two. Recording it once lets a single shortcut repeat the same formatting every week.

Open the workbook with the header row in view. Leave Use Relative References off, because you want the macro to always format A1:F1. Click Record Macro, name it FormatHeader, set the shortcut to f, and click OK. Select A1:F1, apply bold, the grey fill and centring, then click Stop Recording.

Do not name the macro FMT1. That is a valid cell address, because column FMT exists in Excel. Excel may show an error saying the name is not valid. FormatHeader works, and so does Format_Header. Spaces are not allowed, so Format Header fails.

Relative references: the setting that moves the macro

A recorded macro repeats the addresses you clicked, unless relative references are on. With the toggle off, the macro always hits A1:F1, even if you run it on a sheet with the headers somewhere else. With Use Relative References on, Excel records your selection relative to the active cell.

Test both versions on a copy. Record a short macro with the toggle on, move to a different cell, run it, and see where the change lands. Then record again with the toggle off and compare. Keep the version that matches how your data is laid out.

Worked example: a macro that adds a total

Now a second example. Say column B holds sales from row 2 down to row 40, and you want a total in B41 each time you paste new data. Click B41 first, because that cell becomes your starting point.

Turn on Use Relative References before you click Record Macro. Click Record Macro, name the macro AddTotal, keep This Workbook selected, and click OK. Type =SUM(B2:B40) in B41 and press Return. Then click Stop Recording.

With relative references on, the formula moves with the cell you start from. Run the macro from a different row and the total follows that row. Check the cell address after each run, because a macro that starts from the wrong cell writes its total in the wrong place.

Naming, storing and shortcut rules

  • Macro name: start with a letter, then add letters, numbers or the _ character.
  • Macro name: no spaces, and no name that is also a cell reference, such as FMT1.
  • Store macro in: keep This Workbook selected, the only choice Microsoft lists for Mac.
  • Shortcut key: one letter, upper or lower case.
  • Lowercase letter: run with Option+Command+letter, or Control+letter.
  • Uppercase letter: run with Control+Shift+letter.

Macro security: why a recorded macro may not run

Excel for Mac sets macro rules in Excel > Preferences > Security. The three choices are Enable all macros, Disable all macros with notification and Disable all macros without notification. The default is Disable all macros with notification.

The default protects you from code in files you did not write. It also means a macro you recorded may stay blocked until you allow it. Check this setting first whenever a macro does nothing on a new Mac.

Office desk with a spreadsheet open on a computer, the kind of file where a macro in Excel on Mac saves clicks
Formatting the same headers each week is a good first macro. · Image by Pexels from Pixabay

Excel for the web cannot record or run macros

Excel for the web can open and keep a workbook that contains macros. It cannot create, run or edit VBA macros. If your file lives in a browser, select Open in Desktop App above the ribbon. Then record, run and edit in Excel for Mac, and save the file as a macro-enabled workbook.

Edit, review and delete a macro later

Click Developer > Macros to see every macro in the open workbook. Select one, then choose Options to change its shortcut or description. Choose Edit to open the code editor. Inside the editor, F5 runs the macro, and F8 steps through it one line at a time.

You do not need to read the VBA code to use a basic macro. Opening it once still helps you see what the recorder stored. Microsoft's Developer tab article also covers deleting a macro, so read it before you remove anything from a file you rely on.

Test the macro without breaking your file

Save a copy with File > Save As before you run a new macro on live data. Run it on the copy, then check the cells that changed. If something looks wrong, record again from the starting cell rather than editing in a hurry.

Keep the original file until the macro has worked on several copies. Macros repeat mistakes as fast as they repeat good steps, so a short check after each run pays off.

Mistakes people make when recording a macro

  • Extra clicks. Every click you make is part of the recording, so plan the steps before you start.
  • No Stop Recording. Keep working after you finish and the macro keeps every action. Click Stop Recording as soon as you are done.
  • Clashing shortcuts. While the workbook is open, a macro shortcut overrides the matching Excel shortcut. Uppercase letters are safer, because they use Control+Shift.
  • Wrong starting cell. Check the active cell before you click Record Macro, especially when relative references are on.
  • Name rules. Spaces and cell-like names get rejected. Pick a name with letters, numbers and _ only.
  • Wrong file format. Save as a macro-enabled workbook, .xlsm, so the code stays in the file.

Does this still work in 2026?

The latest Excel for Mac build in Microsoft's release notes is 16.114.3 (Build 26102720), dated October 27, 2026. The 2026 entries cover Office Scripts changes and quality fixes. They do not mention VBA, the Developer tab, the ribbon or Preferences, so the steps in this guide still apply. Later builds may exist, so check the release notes if a step looks different on your screen.

Over 40%

of workers spend at least a quarter of their week on manual, repetitive tasks

Smartsheet: How much time are you wasting on manual, repetitive tasks?

16.114.3

Latest Excel for Mac build in Microsoft's release notes, dated October 27, 2026

Release notes for Office for Mac

Where to go next with macros

Once your first macro works, you can build on it. Many macros read input from a named area, so name your input range before you record. Microsoft's Run a macro guide notes that a macro workbook can run a macro on open, through a Workbook_Open procedure. That needs code editing, so start with a short recorded macro first.

Formulas and named ranges make macros easier to maintain. Read how to create a named range in Excel on Mac before you reuse a macro on a bigger file. If your work leans on lookups, how to use XLOOKUP in Excel on Mac covers that side of the job.

Excel shortcuts for this on Mac

Excel keyboard shortcuts on Mac
To do thisPress
Run a macro with a lowercase shortcut letter⌥⌘letter
Run a macro with a lowercase letter using Control⌃letter
Run a macro with an uppercase shortcut letter⌃⇧letter
Run the macro from the code editorF5
Step through a macro one line at a timeF8

If it does not work

The Developer tab does not appear
Open Excel > Preferences > Ribbon & Toolbar. Under Main Tabs, tick Developer, then click Save. Check that box first.
Excel rejects the macro name
Start with a letter, use only letters, numbers and _, and avoid names like FMT1 that look like cell references. Stop and record again with a valid name.
The macro does nothing when you run it
Check Excel > Preferences > Security. With Disable all macros with notification selected, macros stay blocked until you allow them. Enable all macros removes the block for every file, so use it only for files you trust.
The shortcut triggers an Excel command instead
A macro shortcut overrides matching Excel shortcuts while the workbook is open. Record again with an uppercase letter, which runs with Control+Shift, or pick a different letter.
The macro changes the wrong cells
The macro likely used fixed addresses. Turn on Use Relative References on the Developer tab before you record, then record again from the cell you want as the starting point.
Record or run is unavailable in Excel for the web
Excel for the web cannot create, run or edit VBA macros. Select Open in Desktop App above the ribbon, then work in Excel for Mac.

Faster with Lazur

Do it faster: ask Lazur while you are in Excel

Hold ⌥ ⌘ and say what you want. Lazur sees your Excel window. Lazur draws a circle and a label around the button or menu you need.

  • 1

    Hold ⌥⌘ and talk

  • 2

    Lazur draws a circle and a label around the button or menu you need.

  • 3

    You stay in Excel. Nothing to copy into a chat window.

Free for 3 days, then $18/month. Download for Mac

You say“Where is the Record Macro button?”

Lazur · points at itLazur circles Record Macro on the Developer tab and labels it. It points and explains, and you click the button yourself.

Excel
HomeInsertRecord MacroRight hereDrawFormulasDataReview

Questions people ask

Does Excel for Mac have a keyboard shortcut for Record Macro?

Microsoft's Mac article does not list one, so click Record Macro on the Developer tab. The shortcut you set in the dialog is different. It runs the macro after you have recorded it.

Which versions of Excel for Mac support these steps?

Microsoft's Developer tab article covers Excel for Microsoft 365 for Mac, Excel 2024 for Mac and Excel 2021 for Mac. If you run an older version, check Excel > Preferences > Ribbon & Toolbar first. The menu items may look different.

Can I record a macro in Excel for the web?

No. Excel for the web cannot create, run or edit VBA macros. It can open and keep a workbook that has macros. Use Open in Desktop App above the ribbon to work on them in Excel for Mac.

Why does my macro not run when I open the file?

Check Excel > Preferences > Security. The default is Disable all macros with notification, so macros stay blocked until you allow them. Only choose Enable all macros for files you trust.

Can a macro shortcut break an Excel shortcut?

Yes. While the workbook is open, a macro shortcut overrides the matching Excel shortcut. Microsoft's example is Undo. An uppercase letter, which runs with Control+Shift, lowers the chance of a clash.

Do I need to save the workbook in a special format?

Save it as a macro-enabled workbook, .xlsm. Microsoft's guide on running macros describes this format for workbooks that contain macros. Keep your original file as a backup until the macro works on a copy.

How much time can a macro save?

It depends on the task. Smartsheet reports that over 40% of workers spend at least a quarter of their week on manual, repetitive tasks. That is a general figure, not a measure of your own week.

Sources

  1. Use the Developer tab to create or delete a macro in Excel for Mac · Microsoft Support · checked 2026-11-09
  2. Run a macro in Excel · Microsoft Support · checked 2026-11-09
  3. Work with VBA macros in Excel for the web · Microsoft Support · checked 2026-11-09
  4. Enable or disable macros in Office for Mac · Microsoft Support · checked 2026-11-09
  5. Set preferences for macro security in Office for Mac · Microsoft Learn · checked 2026-11-09
  6. Release notes for Office for Mac · Microsoft Learn · checked 2026-11-09
  7. Smartsheet: How much time are you wasting on manual, repetitive tasks? · Smartsheet · checked 2026-11-09

Try Lazur free for 3 days

Hold a key and ask. Lazur sees your screen, points at the button and talks you through it, in any Mac app. No credit card.