Quick & Easy If You Know

CraigWolfenden

New Member
Joined
Sep 9, 2010
Messages
39
Hello All,

Thank you for everyone who has helped me with my current project. It is really appreciated.

I do however have one more question and I promise to leave everyone alone.

How do you allocate a button (from the control toolbox from the toolbar) to run a macro when clicked?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi

You need to place the macro name you want to run in the click event of the button. Whilst in Design mode, right-click on the button and select View Code:

Code:
Private Sub CommandButton1_Click()
Name_Of_Macro_You_Want_To_Call
End Sub
 
Upvote 0
In Excel version 2003 you would Right click with your cursor near the Toolbars at the top of the screen and select the Forms Toolbar. Assuming the macro is already written chose the "Button" Command and drag it onto the screen. The program will then ask you which macro you would like to assign and you click on the one you want.

That is in 2003. What version are you running?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,335
Members
452,636
Latest member
laura12345

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