You can assign a macro to a button in Excel’s Quick Access toolbar. The Quick Access Toolbar sits either above or below the Ribbon. You can add a custom button that will run your macro by following these steps:
- Right-click any Ribbon control, and select Customize Quick Access Toolbar.
- Click the Quick Access Toolbar button on the left of the Excel Options dialog box.
- Select Macros from the Choose Commands From drop-down list on the left.
- Select which workbook you want to add, in this example we choose HelloWorld.xlsm from the Customize Quick Access Toolbar drop-down list on the right. If you specify a specific workbook, the macro button can only be displayed in the workbook you specify.
- Select the macro you want to add. In this example, we choose Helloworld macro.
- Click the Add button.
- Select the macro we just added and click the Modify button to change the icon.
- Pick a symbol and click OK button to complete modify icon.
- Click OK button to save your modify.
- Now, your will find the button in Excel’s Quick Access toolbar.
- Finally, please don't forget to save your workbook.
Now, you can run your macro by clicking the macro button we just added.