Assign a macro to Command Button Object

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

Guest

When I right click on my command Button to locate the option of assign to
macro its not their. How do I get the option to assign to macro to appear?
The other options are available to me on the command button but not the
assign to macro???
 
Hi Dallin,

If the button is from the Control Toolbox, double-click the button which
will take you to the sheet module and provide you with a macro stub for the
CommandButton something like:


Private Sub CommandButton1_Click()

End Sub


Insert insert the body of your macro between the two stub lines.

Alternatively, if the macro you want to use is in a standard module, simply
add the line:

Call MyMacro

between the stub lines, replacing 'MyMacro' with the name of your macro.
 
Back
Top