Click the Office button, and then click Excel Options.
![Click the Office button, and then click Excel Options.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Click_Office_Button_And_Then_Click_.PNG)
In the left pane, click Popular.
Select the Show Developer tab in the Ribbon.
![In the left pane, click Popular. Select the Show Developer tab in the Ribbon.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___In_Left_Pane_Click_Popular_Select_S.PNG)
Click the Developer or View tab.
![Click the Developer or View tab.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Click_Developer_Or_View_Tab.PNG)
To record a macro with actions relative to the initially selected cell, click the Use Relative References button.
![To record a macro with actions relative to the initially selected cell, click the Use Relative References button.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___To_Record_Macro_With_Actions_Relati.PNG)
Click the Record Macro button.
![Click the Record Macro button.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Click_Record_Macro_Button.PNG)
Type a name for the macro. Assign a shortcut key to run the macro.
![Type a name for the macro. Assign a shortcut key to run the macro.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Type_Name_For_Macro_Assign_Shortcut.PNG)
Click the Store macros in list arrow, and then select:
Personal Macro Workbook to use the macro whenever you use Excel.
New Workbook to use the macro in new workbooks.
This Workbook to use the macro only in this workbook.
![Click the Store macros in list arrow, and then select:](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Click_Store_Macros_In_List_Arrow_An.PNG)
Type a description. Click OK.
![Type a description. Click OK.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Type_Description_Click_Ok.PNG)
Execute the commands.
![Execute the commands.](http://www.java2s.com/Tutorial/Microsoft-Office-Excel-2007Images/Record_Macro___Execute_Commands.PNG)
Click the Stop Recording button.