2

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.

Community
  • 1
  • 1
Michael Downey
  • 687
  • 3
  • 13
  • 42

2 Answers2

7

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

Jack
  • 3,878
  • 15
  • 42
  • 72
  • Sometimes I use the controls as shown in the document, but when things get complex, the controls have problems. I use more and more the technique described [here](http://stackoverflow.com/questions/17619558/using-radio-buttons-in-an-excel-macro/17620806#17620806) – stenci Jul 26 '13 at 23:22
3

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.

jonsca
  • 10,218
  • 26
  • 54
  • 62