Assign a Macro to a Command Button

  • Thread starter Thread starter oibobadilla
  • Start date Start date
O

oibobadilla

How do I assign a macro to a command button. I already recorded the
macro, and I would like to know how to assign the macro to button?

Thanks in advance for the help!
 
Hi,

You don't say where the command button is (VBE or spreadsheet) and you
haven't told us what kind of button Form toolbar or Control Toolbox (in the
spreadsheet).

Forms command button - when you add it to the spreadsheet you will be
prompted to assign macro. Later you can attach it by right clicking the
button and picking Assign Macro.

Control Toolbox button - right click the button and choose View code or
double-click the button.

On a user form - double click the command button and you will be in the code
block for the button.
 
Back
Top