How To Add A Form Control Button To Run Your VBA Code

2017-01-23

VBA

If you have a workbook that uses some VBA code and you want an easy way for someone to run the code (i.e. without them having the Developer tab enabled) then a form control button is a good option. The good thing about form control buttons is they can be made very prominent and labelled accordingly like “Click Here To Run” so a user will know what to do.

Step-001-How-To-Add-A-Form-Control-Button-To-Run-Your-VBA-Code How To Add A Form Control Button To Run Your VBA Code

Add your button to a sheet.

  1. Go to the Developer tab in the ribbon. If you don’t see this tab, read How To Enable The Developer Tab.
  2. Press the Insert button found in the Controls section.
  3. Select the Button Form Control from the menu.
  4. Right click and hold the mouse then drag and release to create your button.
  5. The Assign Macro window will pop up and you can select the VBA procedure you want to run from the button.
  6. Press the OK button.

Step-002-How-To-Add-A-Form-Control-Button-To-Run-Your-VBA-Code How To Add A Form Control Button To Run Your VBA Code

To re-label the button to something more meaningful than button1, left click on the button and select Edit Text from the menu. You can also re-assign you button from this menu by selecting Assign Macro.

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Subscribe

Advertisement

Related Articles

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get The Latest News

Follow Us

Follow us on social media to stay up to date with the latest tips in Excel!

Pin It on Pinterest

Share This