assign macro to command button on worksheet

M

Mike V

I have Microsoft Office XP small business installed on my
computer which I purchased August 2001.

On my excel program, I am not able to assign a macro to a
command button on the worksheet. The assign macro option
soes not appear on the command button drop down menu.

Is this a flaw in the excel program or can I add this
option to the drop down menu.

The help instructions state that this option is available.

thanks in advance for your help
 
V

Vasant Nanavati

Only the buttons from the Forms Toolbar can be assigned macros in this
manner. You are probably using a CommandButton from the Control Toolbox,
which you have to double-click (while in design mode) to get to its
associated macro procedure.
 
H

Harald Staff

Adding to Vasant:
Choose "view code" in the dropdown menu. You'll be brought to something like

Private Sub CommandButton1_Click()

End Sub

Make it look like this by performing innovative keyboard operations:

Private Sub CommandButton1_Click()
Call Macro1
End Sub

and you're done. ...Assuming that your macro is named Macro1 that is.
 

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

Top