This lesson shows you how to run a macro from a button in Excel.
Steps to Run a Macro from a Button in Excel
Follow the steps below to use a button for a macro.
Step 1: Open File with Macro and Open Developer Ribbon
Click the Developer tab.
If you have not done so, open file containing the macro. If you do not have a file with a macro, check out creating a basic macro in Excel.
Step 2: Place Button on Sheet
- Click Insert under the Controls group within the Developer ribbon.
- Select the Button icon under Form Controls.
- Click some where on the sheet.
This will open the Assign Macro dialog box.
Step 3: Select a Macro
Select your macro and click OK.
A button should appear on the sheet with sizing nodes, like below.
Note: While the button is selected or in edit mode, you will not be able to click on it.
Step 4: Use Button to Run Macro
- Click some where on the sheet, away from the button. This will unselect the button and take it out of edit mode.
- Click on the button to run the macro.