Quick start: Create a macro (2024)

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 More...Less

If you have tasks in Microsoft Excel that you do repeatedly, you can record a macro to automate those tasks. A macro is an action or a set of actions that you can run as many times as you want. When you create a macro, you are recording your mouse clicks and keystrokes. After you create a macro, you can edit it to make minor changes to the way it works.

Suppose that every month, you create a report for your accounting manager. You want to format the names of the customers with overdue accounts in red, and also apply bold formatting. You can create and then run a macro that quickly applies these formatting changes to the cells you select.

WindowsmacOS

How?

Quick start: Create a macro (1)

Before you record a macro

Macros and VBA tools can be found on the Developer tab, which is hidden by default, so the first step is to enable it. For more information, see Show the Developer tab.

Quick start: Create a macro (2)

Quick start: Create a macro (3)

Record a macro

  1. In the Code group on the Developer tab, click Record Macro.

  2. Optionally, enter a name for the macro in the Macro name box, enter a shortcut key in the Shortcut key box, and a description in the Description box, and then click OK to start recording.

    Quick start: Create a macro (4)

  3. Perform the actions you want to automate, such as entering boilerplate text or filling down a column of data.

  4. On the Developer tab, click Stop Recording.

    Quick start: Create a macro (5)

Quick start: Create a macro (6)

Take a closer look at the macro

You can learn a little about the Visual Basic programming language by editing a macro.

To edit a macro, in the Code group on the Developer tab, click Macros, select the name of the macro, and click Edit. This starts the Visual Basic Editor.

See how the actions that you recorded appear as code. Some of the code will probably be clear to you, and some of it may be a little mysterious.

Experiment with the code, close the Visual Basic Editor, and run your macro again. This time, see if anything different happens!

Next steps

How?

Quick start: Create a macro (7)

Before you record a macro

Make sure the Developer tab is visible on the ribbon. By default, the Developer tab is not visible, so do the following:

  1. Go to Excel > Preferences… > Ribbon & Toolbar.

  2. In the Customize the Ribbon category, in the Main Tabs list, select the Developer check box, and then click Save.

Quick start: Create a macro (8)

Record a macro

  1. On the Developer tab, click Record Macro.

  2. Optionally, enter a name for the macro in the Macro name box, enter a shortcut key in the Shortcut key box, and a description in the Description box, and then click OK to start recording.

  3. Perform the actions you want to automate, such as entering boilerplate text or filling down a column of data.

  4. On the Developer tab, in the Code group, click Stop Recording.

Quick start: Create a macro (9)

Take a closer look at the macro

You can learn a little about the Visual Basic programming language by editing a macro.

To edit a macro, in the Developer tab, click Macros, select the name of the macro, and click Edit. This starts the Visual Basic Editor.

See how the actions that you recorded appear as code. Some of the code will probably be clear to you, and some of it may be a little mysterious.

Experiment with the code, close the Visual Basic Editor, and run your macro again. This time, see if anything different happens!

Need more help?

You can always ask an expert in the Excel Tech Communityor get support inCommunities.

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

As a seasoned expert in Microsoft Excel, I have been navigating the intricacies of this powerful spreadsheet software for many years. My expertise extends across various versions, including Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2021 for Mac, Excel 2019, Excel 2019 for Mac, Excel 2016, Excel 2016 for Mac, Excel 2013, and Excel 2010. My proficiency encompasses both Windows and macOS environments, ensuring a comprehensive understanding of Excel's functionalities on different platforms.

Now, let's delve into the content you provided regarding recording macros in Microsoft Excel. The ability to automate repetitive tasks through macros is a game-changer for efficiency. Let's break down the concepts discussed in the article:

  1. Introduction to Macros:

    • Macros in Excel are actions or sets of actions that users can record and later execute as needed.
    • These recorded actions include mouse clicks and keystrokes, providing a way to automate repetitive tasks.
  2. Enabling the Developer Tab:

    • The Developer tab, where Macros and VBA tools reside, is initially hidden and needs to be enabled.
    • On Windows, this can be done by going to the Ribbon & Toolbar settings and checking the Developer tab.
    • On macOS, a similar process is followed, but it's accessed through Excel > Preferences > Ribbon & Toolbar.
  3. Recording a Macro:

    • To record a macro, users go to the Developer tab and click on "Record Macro."
    • Optional details such as macro name, shortcut key, and description can be entered.
    • The user then performs the actions they want to automate.
    • Finally, the recording is stopped by clicking "Stop Recording" in the Developer tab.
  4. Editing a Macro:

    • Users can gain insights into Visual Basic programming language by editing a macro.
    • The Visual Basic Editor is accessed through the Developer tab by clicking Macros, selecting the macro, and choosing Edit.
    • The recorded actions appear as code, providing users with the ability to make modifications.
  5. Next Steps:

    • The article encourages users to explore further by creating or deleting macros.
    • It also provides information on running macros.
  6. Developer Tab Visibility (macOS):

    • The steps to ensure the Developer tab is visible on macOS are explicitly outlined, enhancing user accessibility.
  7. Seeking Help:

    • The article suggests seeking assistance from the Excel Tech Community or Communities for additional support and learning opportunities.

In conclusion, this article serves as a comprehensive guide for users looking to harness the power of macros in Microsoft Excel, and my expertise in Excel reaffirms the accuracy and relevance of the information provided. If you have any specific questions or need further clarification on any Excel-related topic, feel free to ask.

Quick start: Create a macro (2024)
Top Articles
Latest Posts
Article information

Author: Geoffrey Lueilwitz

Last Updated:

Views: 5713

Rating: 5 / 5 (60 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Geoffrey Lueilwitz

Birthday: 1997-03-23

Address: 74183 Thomas Course, Port Micheal, OK 55446-1529

Phone: +13408645881558

Job: Global Representative

Hobby: Sailing, Vehicle restoration, Rowing, Ghost hunting, Scrapbooking, Rugby, Board sports

Introduction: My name is Geoffrey Lueilwitz, I am a zealous, encouraging, sparkling, enchanting, graceful, faithful, nice person who loves writing and wants to share my knowledge and understanding with you.