How To Run a Macro in Excel: Beginner’s Guide

Learn how to run Excel macros: A comprehensive guide for beginners covering VBA basics, macro recording, and various execution methods.

Table of Contents
Get the help you need from expert talent

Efficiency is key when running a successful business. Every small business owner understands the true meaning behind the popular phrase, “Time is money.” 

Fortunately, Microsoft Excel offers numerous ways to become more efficient without cutting corners or sacrificing accuracy. One valuable tool is the use of Excel macros.

In this article, we’ll look at what Excel macros are and how they can be beneficial to your business in helping to streamline tasks. We’ll provide a step-by-step tutorial on how to create and run a macro in Excel and look at the different methods used to run macros. 

Note that your screens may look somewhat different depending on the version of Excel you’re using.

What are Excel macros?

An Excel macro is an action or set of actions that you can record and run unlimited times to automate repetitive tasks. The macro records your keystrokes and clicks and allows you to rerun them with the push of a single button. The cool thing is that you need to create an Excel macro only once—and then you can rerun it again any time you want. You can also edit a macro after you’ve created it.

Excel macros can help streamline your business processes and save time by facilitating repetitive and tedious tasks, especially when working with large datasets.

For example, let’s say you do the accounting for a marketing agency and need to visually indicate which clients are behind on payments at the end of every week. To do this, you highlight all clients who have paid in green and those who are behind on payments in red and apply bold formatting.

This fairly simple task can quickly become tedious and take a lot of time away from other important and more productive tasks. By creating and running a macro, you can quickly and accurately apply these formatting changes to your selected cells in your Excel file.

First: Enable the Developer tab

To run a macro, you first need to enable the Developer tab to ensure it’s visible on the Excel ribbon. Since it’s not visible by default you’ll need to add it manually.

If you have a Windows computer, follow these steps:

  1. Go to File.
Enable the Developer Tab

  1. Click Options (you can find it at the bottom of the column).
Developer Tab Options

  1. Select Customize Ribbon.
Developer Tab Customize Ribbon


If you have a Mac, you’ll want to follow these steps:

  1. Go to Excel.
Mac Excel

  1. Click Preferences.
Mac Excel Preferences

  1. Select Ribbon & Toolbar.
Mac Excel Preferences Ribbon and Toolbar


For Windows and Mac:
‍You should now be in the Customize the Ribbon section. Under Main Tabs, select the checkbox next to Developer and click Save or OK. You’ll now see the Developer tab in the ribbon.

Developer Tab Customize Ribbon Section
Developer Tab and Main Tabs

How to record a macro in Excel

To automate an Excel macro, you’ll first need to record it. Once it’s recorded, you can run it as many times as you want. Here’s a step-by-step guide on the macro recording process:

  1. Click the Record Macro button or the red bull’s-eye from the Developer tab in the Code group on the left side of the Developer toolbar. (For Windows, you can alternatively press Alt + T + M + R.)
Record a Macro in Excel

  1. Name the macro under the Macro name box and try to be as descriptive as possible. As you become comfortable with macros, you may want to use multiple macros for different purposes, so a descriptive name can help you stay organized. (Note: The macro name needs to start with a letter, but subsequent letters can be numbers, letters, or underscore characters. You won’t be able to use spaces, however.)
  2. Click on the drop-down arrow at the right of the Store macro in box and select where you would like to store it. You can choose This Workbook, Personal Macro Workbook, or a New Workbook.
  3. Type an upper-case or lower-case letter in the Shortcut key box to create a shortcut for the macro. It’s important to note that a macro shortcut key may override any other existing equivalent shortcut keys as long as the Excel workbook that contains the macro shortcut is open. It can happen that Excel prevents you from using an existing shortcut key. In this case, it’s best to come up with a unique key. Here is a list of Ctrl keyboard shortcuts assigned in Excel.
  4. Type a description of what the macro does in the Description box. This step is optional but can help keep your macros organized and avoid confusion, especially if you create multiple macros. This is what steps 2 through 5 should look like:
Record a Macro in Excel Box

  1. Click OK to begin recording.
  2. Complete the steps you’d like to record to perform on future tasks.
  3. Whenever you’ve completed the action, be sure to click Stop Recording or the square black stop recording button in the Developer tab. (For Windows, you can alternatively press Alt + T + M + R.)
Stop Recording a Macro in Excel


You have now successfully recorded a macro.

Other methods for running Excel macros

Excel offers multiple methods to run macros. We look at six and provide step-by-step instructions for using each method.‍

1. Run a macro from the Developer tab

Follow these steps to run a macro from the Developer tab:

  1. Make sure you open the workbook that contains the macro you want to run.
  2. Head to the Developer tab and click on Macros.
Run a Macro From the Developer Tab

  1. Click on the Macro name you want to run and press the Run button.
Click on the Macro Name

2. Run a macro using a keyboard shortcut

If you followed all the steps above explaining how to record a macro in Excel, you’ve already assigned a shortcut key to your macro. However if you have an existing macro without an assigned shortcut key, follow these steps to make the assignment:

  1. Click on Macros in the Code group under the Developer tab.
Run a Macro Using a Keyboard Shortcut

  1. Under the Macro name box, select the macro you want to assign the shortcut key to.
Assign a Shortcut Key to the Macro

  1. Click on the Options button to open the Macro dialog box.
Open the Macro Dialog Box

  1. Type the letter you want for your keyboard shortcut in the Shortcut key box. You may also enter an optional description of the macro in the Description box
Type the Letter for the Keyboard Shortcut

  1. Click OK to save your changes or Cancel to close the dialog box.
  2. Run the macro by using your new shortcut key.some text
           a. If you’re using Windows, press Ctrl + letter for lowercase letters and Ctrl + Shift + Letter for uppercase letters.
           b. If you’re using Mac, press Option + Command + letter for lowercase letters and Ctrl + Shift + Letter.

3. Run a macro from the Visual Basic Editor (VBE)

Here’s how to run a macro from the VBE:

  1. Head to the Developer tab.
  2. Click on Visual Basic to launch the Visual Basic for Applications (VBA) window. You can also open the VBE by pressing Alt + F11 (Windows) or Fn + Opt + F11 (Mac).
Run a Macro from the Visual Basic Editor (VBE)

  1. Open the module containing the macro you want to run under Project Explorer. The pane on the right will list all of the macros available inside the selected module.
Visual Basic Editor (VBE) Project Explorer

  1.  Place your cursor anywhere within the VBA code between Sub and End Sub, and press F5, or go to the toolbar and click on Run>Run Macro to select the macro you want to run.
Select the Macro You Want To Run

4. Add a macro button to the Quick Access Toolbar (QAT)

Here’s how to add a macro button to the QAT:

  1. If you’re working on a Windows computer, go to File > Options > Quick Access Toolbar.some text
          a. Alternatively, if you’re working on a Mac, click on the ellipsis (three dots) in the Quick Access Toolbar and click on More Commands… in the drop-down menu.
Add a Macro Button to Quick Access Toolbar

  1. Select Macros in the Choose commands from list.
Customize the Quick Access Toolbar

  1. Add the desired macro to the list of buttons on the Quick Access Toolbar by selecting the macro and then clicking on Add >>>.
  2. Click Save or OK.‍
Save Changes to Quick Access Toolbar

  1. To run the macro, click on the icon to apply it to your cells. You have now successfully added the macro to the Quick Access Toolbar, where you can access it with a simple click.
Run the Macro

5. Make a macro button from a graphic object

Creating a hot spot on a graphical object can allow you to run an assigned macro by clicking on the assigned graphical object. Here’s how to assign a macro to a graphic object:

  1. Insert a picture, draw a shape, or add any other graphical object to your worksheet.
Insert or Draw a Picture

  1. Right-click on the graphic object and click on Assign Macro…
Assign Macro

  1. Click on the macro to assign it to the graphical object, then click OK. You have now assigned that macro to your graphical object.
Assign Macro to a Graphical Object

  1. Click on the object to run the macro on selected cells.

6. Create a macro button in Excel

Here’s how to create a macro button in Excel:

  1. Click on an area away from your filled cells to place a button.
  2. Click on the Developer tab and Insert.
  3. Click on Button.
Create a Macro Button in Excel

  1.  Select the macro you want to assign to the button, and click on OK.
Select the Macro

  1. To run the macro, click on a cell and then on the button you have created. You have now successfully added a button to your Excel worksheet that will run the assigned macro with a simple click.
Run the Macro

Make the most out of Microsoft Excel for your business

Excel can be very useful to small businesses, but mastering its many features and functions can be time-consuming and challenging. Excel has so many applications that may be confusing and overwhelming to someone not skilled in using all of its functions and capabilities. Engaging an expert for support can be very helpful.

Hiring a freelance Microsoft Excel expert on Upwork can help you get the most out of Excel for your business and increase productivity while freeing up your own time. Browse through our selection of qualified experts. With a simple click, you’ll get a detailed view of each professional’s skills and experiences.

If you’re ready to kick-start your search for a Microsoft Excel professional, sign up for an Upwork account today.

Heading
asdassdsad
Take the first step toward a smarter talent strategy

Author Spotlight

How To Run a Macro in Excel: Beginner’s Guide
The Upwork Team

Upwork is the world’s largest human and AI-powered work marketplace that connects businesses with independent talent from across the globe. We serve everyone from one-person startups to large organizations with a powerful, trust-driven platform that enables companies and talent to work together in new ways that unlock their potential.

Latest articles

Article
The Risks of Hiring Freelancers and How To Navigate Them
Jul 15, 2026
Article
Freelancing Stats 2026: Market Size, Earnings, and Future Trends
Jul 14, 2026
Article
Vibe Coding: The AI-Powered Future of Programming
Jul 13, 2026

Popular articles

Article
How To Create a Proposal On Upwork That Wins Jobs (With Examples)
Jun 24, 2026
Article
Top 9 Machine Learning Skills in 2026 To Become an ML Expert
May 8, 2026
Article
The 6 Highest-Paying Machine Learning Jobs in 2026
Apr 23, 2026
Post your job and find the best fit