Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel Macro Button

Tags:

excel

vba

Is there a way to create a button in Excel to trigger a Macro. So say I have a button that says "Start" that I can click to start a Macro instead of using a hotkey.

like image 413
Michael Downey Avatar asked May 23 '26 14:05

Michael Downey


2 Answers

If you use the 'Forms' toolbar, you will be able to draw a button and assign a macro to it. See here for details.

like image 189
Jack Avatar answered May 25 '26 10:05

Jack


Go into the VBA IDE (by clicking to edit your macro or similar). On the left hand side, right click your project, do Insert,User Form. Drag a command button over from the tools, double click it to generate an event handler.

Fill in the code and run the macro to display the form.

like image 22
jonsca Avatar answered May 25 '26 10:05

jonsca