command button and macros

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

Guest

After placing a command button on a worksheet, how do I go about assigning a
macro to that command button. And, can there be more than one button
controlled macro on a worksheet?

Thank You,
Brian
 
While in design mode, right-click the button and go to
View Code. Insert your code.

HTH
Jason
Atlanta, GA
 
If you're talking about a button from the View > Toolbar > Forms menu then
simply right click the button, Assign Macro and select the macro.
And yes, you can have as many buttons firing the same macro as you like, and
you can have multiple buttons on a sheet firing multiple macros,
Regards,
 
i tried this except when a right clicked on the button there was no assign
macro option, what could be the problem
 
Brian

The problem could be that you created a button using the Control Toolbox.

Right-click and "View Code". Paste your code or a call to your code in there.

Alternative.........

Create the button using the Forms toolbar. That one has the right-click
"assign macro".

Gord Dibben Excel MVP
 
Back
Top