

Make sure that you have the macro already in your workbook before you try to assign it to a button. To do this, right-click the button > click Assign Macro > in the window that opens up, remove all of the text under where it says Macro name: and then hit the OK button. You can easily stop the macro from being assigned to the button, meaning that nothing will happen when the button is clicked.

Stop a Macro from Running When a Button is Clicked This particular macro simply opens a small window and says "Hi!" but you can assign any macro that you want to this button.

Choose the desired macro from the window that opens and then hit the OK button.Right-click the button and click Assign Macro.Put the button into the spreadsheet and move and size it how you want and even add text to it by clicking it and typing. Go to the Insert tab and click the Shapes button and select the desired button shape. Steps to Have a Macro Run When a Button is Clicked This allows you to create a button and put it anywhere in the spreadsheet and then to have a macro run when that button is clicked. Make a macro run when you click a button in the worksheet in Excel.
