Assign Macro to Command Button in Excel 2002

DJM1216

Board Regular
Joined
Apr 15, 2002
Messages
102
Hi, I'm trying to assign a macro to a command box in Excel 2002.

When I clicked on "help" within excel the directions don't help me. For example, the directions tell me to right click a sizing handle, and select "Assign Macro" from the shortcut list.

When I right click a sizing handle, my only choices are:

Cut
Copy
Paste
Properties
View Code
Command Button Object
Grouping
Order
Format Control

I have the macro recorded, I just want to know how to assign the macro to the button so that once it's pushed, the macro runs.

Thanks in advance for any help you can provide.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Which toolbar did you use to create the command button?

It sounds to me that you used the Control Tololbox rather than the Forms one.

If that's the case you don't actually assign a macro.

Select View Code when you right click and the VBA editor should open and you will see something like this:

Code:
Private Sub CommandButton1_Click()

End Sub

To use your macro either copy and paste the code from it in here or call it from here.
 
Upvote 0
That did the trick, thank you!

I did use the control toolbox.

Is there an easier button to format? You mentioned "Forms".

Thanks again.
 
Upvote 0
Well the two buttons have there differences.

As to fomatting a button from the Forms toolbar is far more limited than one from the Control Toolbox.

You can change the background and font colour and various other properties.
 
Upvote 0

Forum statistics

Threads
1,214,818
Messages
6,121,725
Members
449,049
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top