Create or delete macro in Excel 2016 for Mac

To automate a repetitive task so that you can do the task again with a single click, you can record a macro in Excel. 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:

    On the Excel menu, click Preferences > View. And then under In Ribbon, Show, check Developer tab.

    Excel for Mac Developer tab Preference
  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.

    Excel for Mac Record Macro
  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.

    Excel for Mac Record Macros Form

    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.

    Select a macro and click the minus sign to delete it

Top of Page

See Also

Run a macro

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!