Use the Developer tab to create or delete a macro in Excel for Mac

To automate a repetitive task so that you can do the task again with a single click, you can use the Developer tab in Excel for Mac to record and run a macro. You can also create a macro by using the Visual Basic Editor in Microsoft Visual Basic for Applications (VBA) to write your own macro programming code. If you no longer use a macro, you can delete it.

Record a macro

When you record a macro, the macro recorder records all the steps required to complete the actions that you want your macro to perform. These steps can include typing text or numbers, clicking cells or commands on the ribbon or on menus, formatting, selecting cells, rows, or columns, and dragging your mouse to select cells on your spreadsheet. The commands for recording, creating, and deleting macros are available on the Developer tab on the Ribbon.

  1. If the Developer tab is not available, do the following to display it:

    1. Select Excel > Preferences > Ribbon & Toolbar.

    2. Under Customize the Ribbon, select Main Tabs and then check Developer.

    3. Click Save and then close Excel Preferences.

  2. On the Developer tab, click Record Macro.

    Note: To create a macro from VBE, click Visual Basic. In the code window of the module, type the macro code that you want to use.

  3. In the Macro name box, enter a name for the macro.

    The first character of the macro name must be a letter. Subsequent characters can be letters, numbers, or underscore characters. Spaces cannot be used in a macro name; an underscore character works well as a word separator. If you use a macro name that is also a cell reference, you may get an error message that the macro name is not valid.

  4. In the Store macro in list, select This Workbook.

  5. In the Shortcut key box, type any lowercase letter or uppercase letter that you want to use.

    Note: The shortcut key will override any equivalent default Excel shortcut key while the workbook that contains the macro is open.

  6. In the Description box, type a description of the macro and click OK.

  7. Complete recording your macro.

  8. On the Developer tab, click Stop Recording.

Top of Page

Delete a macro

  1. On the Developer tab, click Macros.

  2. In the list, click the macro that you want to delete, and click the delete button.

Top of Page

Need more help?

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.