If you have a task that you perform repeatedly, then you can record all the events to achieve that task (keystrokes, mouse clicks … etc.) in a macro.
To record a macro in Excel 2007 follow these steps.
1. Click on the Developer tab. If the Developer tab is not visible, then check this post on how to show the Developer tab:
2. In the Code group Click Record Macro.

3. The Record Macro window will open.

4. Give a name to your macro.
5. Specify a shortcut key(optional).
6. Specify where you want to save the macro.
7. Click OK.
8. Now start performing the task which you want to record. When you are done click Stop Recording.

9. Your macro is now created and is ready to be used. To run the macro:
- Click Macros.
- The Macros window will open.
- Select the macro then click run.


10. You can also run the macro by simply clicking the shortcut key combination.

Before
After
