PDF download Download Article
Automate tasks and increase efficiency in Excel with macros
PDF download Download Article

This wikiHow teaches you how to enable, create, run, and save macros in Microsoft Excel. Macros are miniature programs that allow you to perform complex tasks, such as calculating formulas or creating charts, within Excel. Macros can save significant amounts of time when applied to repetitive tasks, and thanks to Excel's "Record Macro" feature, you don't have to know anything about programming in order to create a macro.

Creating & Using Excel Macros

  • Go to View > Macros > Record Macro to set up your macro and begin recording. Click the Macros button again and click Stop Recording when you're done.
  • Click the Macros button and choose View Macros to view and run your macros.
  • Save your workbook as an .XLSM file to ensure that macros are enabled in the spreadsheet when you or another user opens the spreadsheet the next time.
Section 1 of 3:

Recording a Macro

PDF download Download Article
  1. If you opened a blank workbook, enter any data that you want to use before proceeding. Otherwise, open an Excel sheet that you've previously made before getting started.
  2. It's at the top of the Excel window.
    Advertisement
  3. It's at the end of the ribbon, and it has an icon of a spreadsheet with a red scroll in front of it.
  4. It's in the dropdown menu. A pop-up window will appear.
  5. In the "Macro name" text box, type in the name for your macro. This will help you identify the macro later.
  6. Press the Ctrl key along with another letter key (e.g., the E key) to create the keyboard shortcut. You can use this keyboard shortcut to run the macro later.
    • On a Mac, the shortcut key combination will end up being Option+ Command and your key (e.g., Option+ Command+T).
  7. This is the default option, but you may need to select it if you see a different option selected. Your macro will be stored inside your spreadsheet, making it possible for anyone who has the spreadsheet to access the macro.
  8. If you want to add a description about what this macro does, type it into the "Description" field. Otherwise, you can skip this and move to the next step.
  9. It's at the bottom of the window. Doing this saves your macro settings and begins recording.
  10. Any step you perform between clicking OK and clicking Stop Recording while be added to the macro. For example, if you wanted to create a macro that turns two columns' worth of data into a chart, you would do the following:
    • Click and drag your mouse across the data to select it.
    • Click Insert
    • Select a chart shape.
    • Click the chart that you want to use.
  11. It's in the View tab, under the Macros button. To view your macros, click the Macros button again and choose View Macros. Your macro will be listed, and you'll be able to run, edit, or configure your macro as you see fit.
  12. Advertisement
Section 2 of 3:

Running a Macro

PDF download Download Article
  1. This option is at the top of the Excel window.
    • You can also just press the key combination you set for the macro. If you do so, the macro will run, and you can skip the rest of this method.
  2. You'll find it in the View tab's toolbar. A dropdown menu will open.
  3. A pop-up window with all of your macros will appear.
  4. Click the name of the macro that you want to run.
  5. It's on the right side of the window. Your macro will begin running.
  6. Depending on how large your macro is, this can take several seconds.
  7. Advertisement
Section 3 of 3:

Saving a Macro-Enabled Spreadsheet

PDF download Download Article
  1. If you don't save your spreadsheet as a macro-enabled spreadsheet (XLSM format), the macro won't be saved as part of the spreadsheet, meaning that other people on different computers won't be able to use your macro if you send the workbook to them.
  2. It's in the upper-left corner of the Excel window (Windows) or the screen (Mac). Doing so will prompt a drop-down menu.
  3. This option is on the left side of the window (Windows) or in the drop-down menu (Mac).
  4. It's in the column of save locations near the left side of the window. A "Save As" window will open.
    • Skip this step on a Mac.
  5. In the "Name" text box, type in the name for your Excel spreadsheet.
  6. Click the "Save as type" drop-down box, then click Excel Macro-Enabled Workbook in the resulting drop-down menu.[1]
    • On a Mac, you'll replace the "xlsx" at the end of the file's name with xlsm.
  7. Click a folder in which you want to save the Excel file (e.g., Desktop).
    • On a Mac, you must first click the "Where" drop-down box.
  8. It's at the bottom of the window. Doing so will save your Excel spreadsheet to your selected location, and your macro will be saved along with it.
    • When you open a macro-enabled spreadsheet, you'll need to click the Enable Content button at the top of the screen to use the macros saved within the workbook.
  9. Advertisement

Community Q&A

Search
Add New Question
  • Question
    Can I use a macro that I create in other spreadsheets and future spreadsheets on the same pc?
    Community Answer
    Community Answer
    Yes, you can use a macro that you crate in other spreadsheets and future spreadsheets on the same pc.
  • Question
    How can I write macros that will change a spreadsheet as soon as I create it?
    Community Answer
    Community Answer
    You will first need a basic understanding of VBA. There are many tutorials on this.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

  • Macros are generally useful for automating tasks that you must perform often, such as calculating payroll at the end of the week.
Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

Warnings

  • Although most macros are benign, some macros can maliciously change or delete information on your computer. Never open a macro from a source that you don't trust.
Advertisement

You Might Also Like

Write a Simple Macro in Microsoft Excel Write a Simple Macro in Microsoft Excel
Automate Reports in ExcelAutomate Reports in Excel
View Macros in ExcelView Macros in Excel
Create a Custom Macro Button in ExcelCreate a Custom Macro Button in Excel
Remove a Macro in ExcelRemove a Macro in Excel
Create a Form in a Spreadsheet Create a Form in Excel: Step-by-Step Guide
Add Rows in Excel with a FormulaAdd Rows in Excel with a Formula
Edit Data in Microsoft Excel3 Simple Ways to Edit Data in MS Excel
Use Google Spreadsheets Use Google Sheets: The Ultimate Guide for Getting Started
Make a Spreadsheet in ExcelMake a Spreadsheet in Excel
Create a User Defined Function in Microsoft Excel Create a User Defined Function in Excel
Enable Macros in PowerPointEnable Macros in PowerPoint
Use ExcelNew to Excel? Here's Super Easy Tricks to Get You Started
Create a Calendar in Microsoft Excel Create a Calendar in Microsoft Excel: 3 Easy Methods
Advertisement

About This Article

Hannah Dillon
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Hannah Dillon. Hannah Dillon is a Technology Writer and Editor at wikiHow. She graduated with a B.A. in Journalism from North Dakota State University in 2013 and has since worked in the video game industry as well as a few newspapers. From a young age Hannah has cultivated a love for writing and technology, and hopes to use these passions in tandem to help others in the articles she writes for wikiHow. This article has been viewed 785,951 times.
How helpful is this?
Co-authors: 20
Updated: October 8, 2025
Views: 785,951
Categories: Microsoft Excel
Article SummaryX

1. Enable Developer options in Excel.
2. Click the Developer tab.
3. Click Record Macro.
4. Enter the macro name and details.
5. Click OK.
6. Perform the macro's steps.
7. Click Stop Recording.

Did this summary help you?

Thanks to all authors for creating a page that has been read 785,951 times.

Is this article up to date?

Advertisement