In Excel for Mac, turn on the Developer tab, choose Developer > Record Macro, perform the steps you want automated, and select Developer > Stop Recording. Replay the macro from Developer > Macros, and save the workbook as an Excel Macro-Enabled Workbook (.xlsm) if it needs to keep the macro.
What a macro recorder does on a Mac
A macro recorder captures a sequence of supported actions in an application and turns them into instructions that can be repeated. In Excel for Mac, the recorder writes those instructions as VBA (Visual Basic for Applications) code. For example, you could record selecting a range, applying a number format, adding a heading, and adjusting column widths, then run that sequence on another worksheet.
There is no single built-in macOS recorder that records every action in every Mac app and turns it into a universal macro. The right tool depends on what you want to automate. Excel’s recorder is for Excel work; macOS Shortcuts and Automator can automate certain app and system workflows; dedicated utilities can repeat keyboard and mouse actions. These tools are not interchangeable, so this tutorial begins with Excel, where “record a macro” has a specific meaning.
Prepare Excel before recording
First, save a copy of the workbook or use a small test workbook. A recorded macro can make many changes quickly, and Excel’s Undo command generally cannot reverse actions performed by a macro. A test run helps catch a wrong starting cell, an unintended selection, or a step that depends on a particular sheet.
If the Developer tab is not visible, open Excel’s ribbon settings and enable it. In many current versions, the path is Excel > Settings (or Preferences) > Ribbon & Toolbar; select Developer in the main tabs list and save the change. The wording and layout can vary slightly between Excel releases. Once enabled, Developer appears in the ribbon.
Before recording, decide whether the macro should act on a fixed range or work relative to the currently selected cell. Excel’s Developer tab may include a Use Relative References control. With relative references turned off, recorded selections and cell references commonly point to the same locations each time. With them turned on, actions can be recorded in relation to the starting selection. Choose deliberately, and test on a different starting cell if you expect to reuse the macro across rows or sheets.
Record a macro step by step
- Open the workbook and select the worksheet and starting cell that the macro should use.
- Choose Developer > Record Macro. In the dialog, enter a name that begins with a letter and contains no spaces; use an underscore if needed, such as Format_Report.
- Choose where to store the macro. This Workbook keeps it with the current file. Personal Macro Workbook makes it available in Excel on that Mac in future sessions, but it will not travel automatically with a workbook sent to someone else.
- Optionally enter a description. If you assign a shortcut, check the dialog’s instructions carefully so it does not replace a shortcut you already use.
- Choose OK, then carry out only the steps you want repeated. For example, select a report’s total row, apply bold formatting, set a currency format, and adjust the column width.
- When finished, choose Developer > Stop Recording. Do this promptly: extra clicks and selections made while recording may become part of the macro.
Keep the recorded sequence as simple as possible. A macro that relies on a specific active sheet, selected cell, or window state may fail or affect the wrong place if those conditions change. If the task is meant to run on a different range each time, test that behavior rather than assuming the recorder has understood your intention.
Run and review the recorded macro
To run it, choose Developer > Macros, select the macro by name, and choose Run. Check the result before using it on important data. For a formatting macro, confirm that it changed only the intended cells. For a macro that edits or clears data, test with a duplicate sheet or disposable file first.
You can inspect or adjust the generated VBA by opening the Visual Basic Editor from the Developer tab. The recorded code can reveal why a macro behaves differently than expected: it may refer to a particular worksheet, cell address, or selection. Editing code is optional; the recorder is useful even if you do not plan to become a VBA programmer. If you do edit it, make a backup and change one thing at a time, then test again.
A common misconception is that recording creates a smart instruction such as “format the current month’s sales.” Usually, it records specific operations, not the goal behind them. If the data moves or the layout changes, a recorded macro may still target the old range. More flexible automation can require editing the VBA or using a different approach.
What Excel’s recorder can and cannot automate
The recorder is well suited to repeatable tasks made from actions Excel exposes to VBA, especially formatting, cell selection, copying, pasting, and some worksheet operations. It is a practical starting point for automating a task that you already perform manually in a consistent way.
It does not record every aspect of using a Mac. It will not turn arbitrary Finder actions, actions in unrelated apps, or every mouse gesture into a portable Excel macro. Some commands and interface interactions are not recorded in a useful way. A macro can also depend on workbook structure, data layout, or active selection. If the task involves conditions, changing file locations, or many possible data shapes, a manually designed VBA procedure or another automation tool may be more reliable than a raw recording.
Excel for Mac supports VBA, but code written for Windows is not guaranteed to work unchanged on a Mac. Macros that depend on Windows-only components, ActiveX controls, or particular Windows file paths may need substantial changes or may not be suitable. If a workbook will be shared across Mac and Windows, test it in both environments and avoid platform-specific dependencies where possible.
Save, share, and preserve macros
A standard .xlsx workbook cannot store VBA macros. To keep a macro inside the workbook, use File > Save As and select Excel Macro-Enabled Workbook (.xlsm). If you save a macro-enabled file as .xlsx, Excel warns that the macro content will not be preserved in that format. Keep the .xlsm version if the automation matters.
When sharing a workbook, tell the recipient that it contains a macro and what the macro is intended to do. A macro stored in This Workbook travels with the .xlsm file, but the recipient’s Excel security settings determine whether it can run. A macro in your Personal Macro Workbook is local to your Excel setup, so it is not included just because you email a separate workbook.
For long-term use, document the purpose, expected starting sheet or selection, and any assumptions about columns or data. That small note is useful when you return to the file months later or pass it to a colleague. Keep a clean, non-macro copy of important source data as well.
Safety and common problems
Macros can alter workbook contents, and VBA can perform actions beyond simple formatting. Only enable macros in files from sources you trust and when you understand why they are needed. If a file arrives unexpectedly, do not enable its macros just because Excel displays a prompt. Ask the sender through a trusted channel or obtain a clean copy. Macro security controls and their exact labels can differ by Excel version; check Excel’s security or macro settings rather than weakening protections for all files.
- The Developer tab is missing: enable it in Excel’s Ribbon & Toolbar settings, then reopen the workbook if necessary.
- The macro is not listed: confirm that it was saved, that the correct workbook or Personal Macro Workbook is open, and that Excel is not blocking macros.
- It changes the wrong cells: check the starting selection, active worksheet, and whether relative references were enabled during recording.
- The macro disappears after saving: save as .xlsm rather than .xlsx, and confirm the format in the Save As dialog.
- It works on one Mac but not another: check Excel versions, macro permissions, workbook paths, and any code that depends on Windows-specific features.
Alternatives for other Mac automation
If the task is not an Excel task, choose a tool designed for its scope. Shortcuts, included with current macOS versions, can connect supported actions and apps into workflows; it is not a recorder that automatically captures every click in any application. Automator, Apple’s older workflow app, remains available on many Macs, though Apple’s direction for newer automation is Shortcuts and availability or integration can depend on macOS version.
For repeated keyboard-and-mouse sequences across Mac apps, third-party utilities such as Keyboard Maestro or BetterTouchTool may offer more direct interaction automation. Their capabilities, compatibility, and pricing can change, so check the developer’s current documentation before choosing one. Accessibility permissions may be required for tools that control other apps. Consider whether a task is better handled by an app’s built-in automation, a script, or a menu command before recording mouse movements: screen changes can make click-based routines fragile.
Frequently Asked Questions
Does Mac have a built-in macro recorder?
Excel for Mac includes a macro recorder for Excel actions. macOS does not provide one universal recorder for every app; Shortcuts and Automator create supported workflows, while other tools serve different automation needs.
How do I stop recording a macro in Excel for Mac?
Choose Developer > Stop Recording. Stop as soon as the intended actions are complete so that unrelated selections or clicks are not included.
Can I record a macro in Excel without coding?
Yes. Use Developer > Record Macro, perform the actions, and stop recording. The recorder creates VBA behind the scenes, but you do not need to write code to record and run a basic macro.
Why does my macro not work on another Mac?
Check that the workbook is saved as .xlsm, that the recipient permits the macro, and that the macro does not rely on a local file path, different workbook layout, or Windows-only feature.
Can I undo a macro in Excel?
Do not rely on Undo to reverse a macro. Save a backup or test copy before running one, especially if it changes, clears, or replaces data.
Related
- Excel Slicer Search Box: How to Find Items
- Excel Slicer Examples for PivotTables and Tables Explained
- Excel Slicer Font Size: What You Can and Can’t Change
Try it: the Column Letter to Number: aA is 27, XFD is 16,384. Converts both ways.
More in VBA & macros
- Excel VBA Copy and Paste Values OnlyTo copy a range in Excel VBA and paste only its values, use Copy followed by PasteSpecial Paste:=xlPasteValues.…
- Input Box in Excel VBA: Use InputBox and Get DataIn Excel VBA, use InputBox to ask for a text value, or Application.InputBox when you want to restrict…
- Excel VBA Range Using Cells: Syntax, Examples, and TipsIn Excel VBA, use Cells(row, column) to identify a cell by its row and column numbers, and pass…
- VBA AutoFilter Method of Range Class Failed?“AutoFilter method of Range class failed” is usually Excel’s run-time error 1004: VBA tried to apply a filter…
- VBA Array AutoFilter: Filter Data in Memory or ExcelExcel’s VBA AutoFilter method filters a worksheet range or table; it does not filter a VBA array directly.…
- VBA Find Position of a Character in a String with InStrUse VBA’s InStr function to find a character in a string: it returns the character’s 1-based position, or…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.