Add a button and assign a macro to it

You can use a button (a form control) to run a macro that performs an action when a user clicks it. For example, you might use a button to automate the printing of a worksheet, the filtering of data, or the calculation of numbers. The following procedure assumes that you've created a macro already.

  1. On the Developer tab, in the Forms Control group, click Button.

    If the Developer tab is not available

    1. On the right side of the ribbon, click Action pop-up menu, and then click Ribbon Preferences.

    2. Under Customize, select the Developer check box.

  2. Click the worksheet location where you want the upper-left corner of the button to appear.

  3. To create the button, drag in the sheet.

  4. In the Assign Macro dialog box, click the name of the macro that you want to assign to the button, and then click OK.

  5. To specify the control properties of the button, hold down CONTROL and click the button, and then click Format Control.

  6. To test your button, click it. Your macro should run.

See also

Create, run, edit, or delete a macro



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language