assign a macro to a control button

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

Guest

I do not have the option to assign a macro when I right click a control
button that I have placed on a spreadsheet from the control toolbar.
However, when I insert an autoshape, I do have the option when I right click
to assign a macro. This causes an error in that the file path cannot be
found, even though the macro works when accessed the usual way.

Can anyone help me please??
 
Hi ewan72

Press the first button on the control toolbox toolbar to go into the design
mode
Double click on the button you placed on your worksheet.
The VBA editor will open with this

Private Sub CommandButton1_Click()

End Sub

You can place the code in the event or place the macroname in the event.
Press Alt-q to go back to Excel and press the first button on the
control toolbox again to exit the design mode

If you use Excel 97 Change the takefocusonclick property to false in the properties of the button
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top