Button to Activate Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have recorded a simple macro to hide a few columns of an Excel spreadsheet. I would like to run the macro from a click event for a button control. I added the button from the control toolbox. When I right click on the control, "assign macro" is not one of my available choices. I can see no way to make the object perform the macro task. What am I missing here?

Thanks
 
Jon,

Control toolbox buttons are event driven, so go into design mode (the
triangle on the control toolbar) and double-click the button. You will then
be presented with a skeletal procedure where you can add your code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Jon said:
I have recorded a simple macro to hide a few columns of an Excel
spreadsheet. I would like to run the macro from a click event for a button
control. I added the button from the control toolbox. When I right click
on the control, "assign macro" is not one of my available choices. I can
see no way to make the object perform the macro task. What am I missing
here?
 
Jon

Or use a button from the Forms Toolbar. These have the "Assign macro" option.

Gord Dibben Excel MVP
 
Back
Top