assigning macro to a button

K

Kelly

all the help says right click on the button and select assign macro. When I right click on a button that is not an option. I am using office 2003. has this changed in this verion?

I have already recorded a macro and want to add a button to run it within the worksheet. I was able to add a toolbar button, but when I send this file, the button does not go with the file.

Help.
 
R

Ron de Bruin

Hi Kelly

On a button from the Forms Toolbar you can right click and assign a macro

If you have a button from the control toolbox
Press the first button on the controltoolbox 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
controltoolbox again to exit the design mode


--
Regards Ron de Bruin
http://www.rondebruin.nl


Kelly said:
all the help says right click on the button and select assign macro. When I right click on a button that is not an option. I am
using office 2003. has this changed in this verion?
I have already recorded a macro and want to add a button to run it within the worksheet. I was able to add a toolbar button, but
when I send this file, the button does not go with the file.
 
B

Bob Phillips

Sure it's not from the control toolbox toolbar?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Kelly said:
all the help says right click on the button and select assign macro. When
I right click on a button that is not an option. I am using office 2003.
has this changed in this verion?
I have already recorded a macro and want to add a button to run it within
the worksheet. I was able to add a toolbar button, but when I send this
file, the button does not go with the file.
 
Top