macro button on spreadsheet

S

SheriTingle

I know how to create a macro and how to attach it to a button on the toolbar.
What I would like to do is place a button out on the worksheet to run the
macro. When I follow the directions in help it doesn't work. THANKS for the
help. I am using Excel 2002.
 
M

Myrna Larson

Can you be more specific about what you mean by "it doesn't work"? Are you
able to create the button? How did you create the button -- via the Forms
toolbar or the Controls Toolbox? Can you create it but don't know how to tell
it to run your macro?
 
S

SheriTingle

When I made the button from the control toolbar help says to right click on
the button to assign the macro. When I make the button from the control
toolbar there is no option to assign a macro.
 
M

Myrna Larson

Help is talking about how to assign the macro to a button from the FORMS
toolbar.

For a button from the CONTROL TOOLBOX, make sure that the CONTROL TOOLBOX is
visible and you are in Design mode (the button in the upper left corner of the
toolbox should be highlighted and "pushed in").

Then double click the button. That will take you to the place where you enter
the code that runs when you click the button. If you've already written the
macro and you called it, say, MyMacro, just type MyMacro inside the Sub/End
Sub lines that Excel wrote for you. i.e. it would look like this:

Private Sub CommandButton1_Click()
MyMacro
End Sub
 
Top