How to assign a macro to a button in Excel
![](https://spreadcheaters.com/wp-content/uploads/Final-Image-How-to-assign-a-macro-to-a-button-in-Excel.png)
Excel offers a very interesting way to assign a macro to a button. We can cater to this problem statement by using the assign macro option of the object. We can perform the below mentioned way to assign a macro to a button in excel:
We’ll learn about this methodology step by step.
To do this yourself, please follow the steps described below;
Step 1 – Excel workbook with a button
![](https://spreadcheaters.com/wp-content/uploads/Step-1-How-to-assign-a-macro-to-a-button-in-Excel.png)
– Open the desired Excel workbook which contains a button
Step 2 – Exploring Assign Macro option
![](https://spreadcheaters.com/wp-content/uploads/Step-2-How-to-assign-a-macro-to-a-button-in-Excel.png)
– Now right click on the button and select the “Assign Macro” option.
Step 3 – Assign macro dialogue box
![](https://spreadcheaters.com/wp-content/uploads/Step-3-How-to-assign-a-macro-to-a-button-in-Excel.png)
– A dialogue box will appear. Click on “New” and then click on “OK”.
Step 4 – Writing a macro
![](https://spreadcheaters.com/wp-content/uploads/Step-4-How-to-assign-a-macro-to-a-button-in-Excel.png)
– Now in the editor space, you can write your macro and then exit the dialogue box.
Step 5 – Macro assigned
![](https://spreadcheaters.com/wp-content/uploads/Step-5-How-to-assign-a-macro-to-a-button-in-Excel.png)
– A macro has been assigned to the button. Whenever you click on the button, the macro will run automatically.