Microsoft Office Tutorials and References
In Depth Information
Assign the macro to a shape
Perform these steps to add a button to your worksheet and to assign a macro to the button:
1. Choose Developer
Controls
Insert and click the Button control in the Form Controls
section.
2. Draw the button on the worksheet.
Excel displays the Assign Macro dialog box.
3. In the Assign Macro dialog box, select the macro from the list.
4. Click OK to close the Assign Macro dialog box.
5. If you want to change the text that appears on the button, to make it descriptive,
rightclick the button, choose Edit Text from the shortcut menu, and make your changes.
After you complete these steps, clicking the button executes the assigned macro.
Assign the macro to a shape
You can also assign a macro to a shape object on a worksheet. Just right-click the shape and
choose Assign Macro from the shortcut menu. Select the macro from the Assign Macro dialog
box and click OK.
After you perform these steps, clicking the shape runs the macro.
Add a button to your Quick Access toolbar
Another way to execute a macro is to assign it to a button on the Quick Access toolbar:
1. Right-click the Quick Access toolbar and choose Customize Quick Access Toolbar to
display the Excel Options dialog box.
2. In the drop-down list on the left, choose Macros.
A list of available macros is displayed.
3. Select the macro from the list and click Add.
4. Optionally, you can click the Modify button, select a different icon, and provide a
different name for the Quick Access Toolbar button.
Add a button to the Ribbon
Excel 2010 allows users to modify the Ribbon, and that includes adding buttons that execute
macros. You need to add a new group, though. (You can’t add a button to a built-in Ribbon
group.) To assign a macro to a button on the Ribbon:
 
Search JabSto ::




Custom Search