Excel Macro Recorder
Recording macros with the Excel Macro Recorder differs from one Excel version to another. Please choose your version.
Excel 2010 / 2007 | Excel 2003
#1 Source for Excel macros on the net
Recording macros with the Excel Macro Recorder differs from one Excel version to another. Please choose your version.
Excel 2010 / 2007 | Excel 2003
Why not use the Excel Macro Recorder for everything? | Record a Macro | Run a Recorded Macro | Edit the Macro
The Macro Recorder, a very useful tool included in Excel VBA, records every task you perform with Excel. This is good news if you want to automate repetitive tasks. All you have to do is record a specific task once. Next, you can execute the task over and over with the click of a button. This can save you a lot of time! The Macro Recorder is also a great help when you don't know how to program a specific task in Excel VBA. Simply open the Visual Basic Editor after recording the task to see how it can be programmed.
Unfortunately there are a lot of things you cannot do with the Excel Macro Recorder. For example, we cannot loop through a range of data with the Macro Recorder. Moreover the Macro Recorder uses a lot more code than is required, which can slow your process down.
To record, run and edit a recorded macro, execute the following steps.
1. Click on the Developer tab. Don't know where to find the Developer tab? Go to the Create a Macro chapter.
2. Click on Record Macro. See the picture below. Each of the commands you perform will be saved into the macro!

3. Here you can give your macro a name and you can enter a shortcut for your macro (both optional). You can store your macro in three workbooks. If you choose to store your macro in Personal Macro Workbook, the macro will be available to all your workbooks (Excel Files). This is because Excel stores your macro in a hidden workbook that opens automatically when Excel starts. If you choose to store your macro in New Workbook, the macro will only be available in an automatically new opened workbook. If you choose to store your macro in This Workbook, the macro will only be available in the current workbook.

We will now record a macro that changes the format of Cells to Percentage.
4. Click on OK.
5. Right mouse click on the active cell (selected cell). Be sure not to select any other cell! Then click on Format Cells...

6. Choose Percentage and click on OK.

7. Finally, Click on Stop Recording.

Congratulations! You've just-recorded a macro with the Excel Macro Recorder!
Now you can test the macro to see if it can change the format of cells to Percentage Format.
1. Enter some numbers between 0 and 1 in Excel. Select the numbers.

2. Click on the Developer tab.
3. Click on Macros.

3. Click on Run.

The format of the cells should change to Percentage Format. Result:

There are two ways to take a look at the just-recorded macro. You can click on Macros from the Developer tab and then click on Edit. The Visual Basic Editor will appear. You can also directly open the Visual Basic Editor by clicking on Visual Basic from the Developer tab (or press Alt+F11).

Our macro has been placed into a module called Module1. Earlier we placed our code created without the Excel Macro Recorder directly on Sheet1. Code placed into a module is available to the whole workbook, while code placed on a sheet is only available for that particular sheet.
Did you find this information helpful? Show your appreciation, vote for us.
Go to Top: Excel Macro Recorder | Go to Next Section: Basics
100 easy to follow Excel VBA examples. Limited time-offer: $39.00 but only $29.00. Ends on 31 May.
Why not use the Excel Macro Recorder for everything? | Record a Macro | Run a Recorded Macro | Edit the Macro
The Macro Recorder, a very useful tool included in Excel VBA, records every task you perform with Excel. This is good news if you want to automate repetitive tasks. All you have to do is record a specific task once. Next, you can execute the task over and over with the click of a button. This can save you a lot of time! The Macro Recorder is also a great help when you don't know how to program a specific task in Excel VBA. Simply open the Visual Basic Editor after recording the task to see how it can be programmed.
Unfortunately there are a lot of things you cannot do with the Excel Macro Recorder. For example, we cannot loop through a range of data with the Macro Recorder. Moreover the Macro Recorder uses a lot more code than is required, which can slow your process down.
The following example illustrates the use of the Excel Macro Recorder.
1. Click on Tools, Macro, Record New Macro.

2. Here you can give your macro a name and you can enter a shortcut for your macro (both optional). You can store your macro in three workbooks. If you choose to store your macro in Personal Macro Workbook, the macro will be available to all your workbooks (Excel Files). This is because Excel stores your macro in a hidden workbook that opens automatically when Excel starts. If you choose to store your macro in New Workbook, the macro will only be available in an automatically new opened workbook. If you choose to store your macro in This Workbook, the macro will only be available in the current workbook.

We will now record a macro that changes the format of Cells to Percentage.
3. Click on OK.
4. Right mouse click on the active cell (selected cell). Be sure not to select any other cell! Then click on Format Cells...

5. Choose Percentage and click on OK.

6. Finally, Click on Stop Recording.

Well done! You have just-recorded a macro with the Excel Macro Recorder!
Note: if you accidentally close the Stop Recording box, go to View, Toolbars, Stop Recording to turn it back on while recording a macro.
1. Enter some numbers between 0 and 1 in Excel. Select the numbers.

2. Click on the Tools, Macro, Macros.

3. Click on Run.

The format of the cells should change to Percentage Format. Result:

There are two ways to take a look at the just-recorded macro. You can click on Macros from the Developer tab and then click on Edit. The Visual Basic Editor will appear. You can also directly open the Visual Basic Editor by clicking on View Code from the Control Toolbox (or press Alt+F11). If you don't know where to find the Control Toolbox, go to the Create a Macro chapter.

In the Project Explorer we see that a new map with the name Modules has been created. Click on Module1 to see the created macro. Code recorded with the Macro Recorder will always be placed into a module (here Module1). Earlier we placed our code created without the Excel Macro Recorder directly on Sheet1. Code placed into a module is available to the whole workbook, while code placed on a sheet is only available for that particular sheet.
Did you find this information helpful? Show your appreciation, vote for us.
Go to Top: Excel Macro Recorder | Go to Next Section: Basics
100 easy to follow Excel VBA examples. Limited time-offer: $39.00 but only $29.00. Ends on 31 May.