Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Recording a Macro.

Recording a Macro

by Allen Wyatt
(last updated November 17, 2018)

4

If you have a repetitive task that is a good candidate for a macro, you can use the macro recording capabilities of Excel to turn your actions into a macro. To record a macro, follow these steps:

  1. Display the Developer tab of the ribbon.
  2. Click the Record Macro tool. Excel displays the Record Macro dialog box. (See Figure 1.)
  3. Figure 1. The Record Macro dialog box.

  4. In the Macro Name field, provide a name you want used for your macro. You can accept the default name, if you desire, but if you plan on using the macro more than once or twice, you will want to use a more descriptive name. The name you provide must not include any spaces.
  5. In the Description box you can provide an optional comment about your macro.
  6. Use the Store Macro In drop-down list to specify where you want the macro stored.
  7. Click OK.

Excel starts recording everything you do. The actions you take become steps in the macro and will be repeated when you later execute the macro. When you have finished the steps you want recorded in your macro, again display the Developer tab of the ribbon and click the Stop Recording tool. (This tool is only available when you are actually recording your macro.) The macro is then saved and available for use at any time.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (5683) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Recording a Macro.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Updating Fields in Locked Forms

Updating form fields in Word can be confusing, especially when the fields are locked in a form. This tips explains why ...

Discover More

Scaling Graphics in a Macro

If you need to make sure that the graphics in a document are all scaled similarly, you'll love the macros presented in ...

Discover More

Saving Information in a Non-Document Text File

Need to store some information in a plain text file? It's easy to do when you use a macro.

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Develop Macros in Their Own Workbook

If you develop macros and edit them quite a bit, you may be running the risk of causing problems with the macros or with ...

Discover More

Disabled Macros

Do your macros seem to be disabled on your new machine? It could be because of the security settings in Excel. Here's ...

Discover More

Stepping Through a Macro with a Worksheet Visible

When developing a macro, it is often necessary to step through the various code lines so you can see what is happening on ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine more than 3?

2018-11-23 05:47:27

Peter Atherton

Raymond

Seems like you use a Mac. On windows there is a short-cut to save the document Ctrl + S, Ctrl + P to print and so on. If you use these shortcuts in your workbook then you will not be able to use them to save or print a file. The usual worokaround is to add the Shift to yhe short cut. e.g Ctrl + shift + S. Try these short cuts to make sure that Excel is nt usng them before they are apied to your workbook.

HTH


2018-11-22 13:02:26

Raymond A Batman

When I use the ctrl+ command I get an insert box that provides ways to shift cells. So that does not allow me to use a shortcut key to record a macro?


2018-11-19 05:50:16

Barry

@JeanE

The macro recorder default to using absolute addresses, which is a nuisance as the majority of times, that I've used the recorder, I want relative addresses. Fortunately, this is easily enabled by slicking the "Use Relative References" in the ribbon on the 'Developer' tab or on older versions of Excel the Use RElative Reference button on the floating "Macro" recorder toolbar.
You can switch between absolute and relative as frequently as you like during the recording of the macro. E.g. I had a macro to go to the last entry in column A - in absolute mode go to the last cell in column A then switch relative to then use the [End} [UpArrow] to go to the last cell.


2018-11-18 11:40:31

JeanE

The steps mentioned to create a macro work great, but only on the cell the macro was recorded in. How do I make the macro run in any other cell in the workbook -- in other words, address free?


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.