MrExcel's Learn Excel #594 - Run Macro Button

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Apr 14, 2009.
Youve created a simple macro and want to assign the macro to a button on a worksheet. In todays question, someone is trying to assign a macro to a button, but it is not working. She can assign the macro to a text box and it works, but not with a button. Episode 594 shows how to assign a macro to a text box, an AutoShape, or a button on the Forms toolbar.

This blog is the video podcast companion to the book, Learn Excel from MrExcel. Download a new two minute video every workday to learn one of the 277 tips from the book!
maxresdefault.jpg


Transcript of the video:
Hey, welcome back to the MrExcel netcast.
I'm Bill Jelen.
Another question that came in a power Excel seminar.
First was trying to assign a macro to run from a button and they said I can't get this to work there's nothing I can do.
I can get it to run from a text box or from any bit of auto shapes or anything like that, but it won't work when I try and run it from a button.
Well, that was really strange that would work from a text box or an auto shape.
You know, generally it's, it's pretty easy to set up a macro to run. We might have an auto shape there.
Basically, just right-click and say assign macro and we can assign the macro to run any time someone clicks on that shape.
So, now of course what you would want to do is add some text to that shape or some color or something to make it look like a button, but it's really much better just to use the button that's built into Excel and I pointed out that if we go to View, Toolbars, there's two different areas that have a button There's a control toolbox.
The control toolbox has a bunch of different controls along with one that is called a Command Button.
If I draw this on the sheet you'll see that it looks like a button, but you can't just assign a macro to that command button what we have to do is go to View, Toolbars, and say we want to see the Forms Toolbar.
The Forms Toolbar is much older, but actually simpler to use there's a button there when we choose that button and drag on the sheet.
It actually comes right up and says hello, hey, what macro do you want to assign click OK and we'll add some text there that says, Run Macro.
So, I guessed that probably what's happening is they were trying to use a command button instead of just a button the icons look exactly the same you have to see whether you're in the forms toolbar or the control toolbar to figure out whether you're getting the old style button easy to use or the new style command button harder to use.
So, if you're having problems, assigning a macro to a button just make sure to use the forums toolbar you'll be good to go.
Hey Thanks for stopping by.
We'll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

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