Create a toolbar button or menu item to run a Macro

Excel 2007
If you assigned a key combination to a macro when you recorded it, you can run the macro by pressing that key combination. If not, you can subsequently assign the macro to the menu item.

Follow these steps:

   1.    Choose Tools -> Customize... to display the Customize dialog box, choose the Commands tab:

Customize Excel 2003

   2.    Select the Macros category to display the list of macros.

   3.    Drag the Custom Menu Item to a menu to create a menu item, or drag the Custom Button item to a toolbar to create a toolbar button:

Item Excel 2003

   4.    With the menu item or toolbar button selected, click the Modify Selection button in the Customize dialog box and choose Assign Macro...:

Assign Macro Excel 2003

   5.    In the Assign Macro dialog box, select the macro to associate with the menu item or toolbar button. If necessary, change the selection in the Macros In drop-down list so that the macro you need is displayed:

Macro Excel 2003

   6.    Click the OK button to close the Assign Macro dialog box and assign the macro.

   7.    Click the Modify Selection button in the Customize dialog box again and use its commands to edit the display name to make it easy to understand or assign a suitable button, or both.

   8.    Click the OK button to close the Customize dialog box.

For more information about how to customize menu and buttons, see Creating your own menu.

If you have any questions or suggestions, please feel free to ask OfficeToolTips team.

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information you’ve provided to them or they’ve collected from your use of their services.

Learn more