add a command button and assugn a macro to it

sullyman4

Board Regular
Joined
Nov 8, 2004
Messages
151
I can get a command button on my worksheet, it does nothing but sit there. I want to assign a macro to it. How is this accomplished
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

shajueasow

Well-known Member
Joined
Oct 7, 2004
Messages
1,926
Right click on th button and select "Assign Macro", and assign the needed macro.
 

sullyman4

Board Regular
Joined
Nov 8, 2004
Messages
151
that is not an option when I right click on it. I have the option of
cut, copy, paste, view code, command button object, grouping, order, format control.
 

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
How did you create the button?
Control toolbox
or the Forms toolbar?

Michael
 

sullyman4

Board Regular
Joined
Nov 8, 2004
Messages
151

ADVERTISEMENT

on my tool bar I have the button, check box , combo box controls.
I click on the button and then click in the worksheet and the button appears. this must not be the way to do it
 

daniels012

Well-known Member
Joined
Jan 13, 2005
Messages
5,219
Ok Try to select your button and double click it. This will put you in VBA, for a button from Control Toolbox.
Or try the method described by shajueasow
for a button from the Forms Toolbar.

Michael
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Sullyman4

It sounds as if you were in Design Mode whilst you were clicking on the macro - if you have the Controls Toolbar open at the same time as you are clicking on the button, you should be able to turn off Design Mode by clicking the Design button on the toolbar.
 

Forum statistics

Threads
1,144,388
Messages
5,724,071
Members
422,533
Latest member
garganod1

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
Top