This lesson shows you how to assign a macro to a command button in Excel. A button is a great way to show the user a clickable item on your sheet. Furthermore, it helps you automate tasks in a user friendly manner.
In part of this lesson, you may see the term right-click. When we say right-click, we simply want you to click the button on the right side of the mouse.
If you do not have a right mouse button, then you can generally use a regular click (left-side) and press the keyboard shortcut Shift-F10.
Note: If you do not have a macro to assign, then check out one of the links in our resources section below. After that, come back and continue the lesson. Otherwise, you can just follow along.
Follow the steps below to complete the task of assigning a macro to a command button.
After you click on the sheet, the Assign Macro dialog box opens.
As a result, your button is now inserted on the sheet with an assigned macro. Unfortunately, you may not be able to do too much formatting using Excel's sheet tools.
When you put the button on the sheet, it will appear with selection nodes. Thus, you will have the opportunity to change the size of the button. And, you can rename the button and change the font size of the text.
Before you run the macro, click somewhere on the sheet to take the button out of edit mode. After you do that, you can click on the button to run your macro.
To return to edit mode, hold the control (Ctrl) key and click on the button. Or, just right-click on the button and press Esc to exit the shortcut menu.
Finally, you are good to go!
Assign a macro to a command button in Excel
by Excel Effects :: October 24, 2020