Simple VBA Question....?????

bfraser

Board Regular
Joined
Apr 15, 2006
Messages
113
I have three macros that I want to run right after each other.
Does anyone know how I would do this and assign them to a single toolbar icon?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Code:
sub driver()
     Call macro1()
     Call macro2()
     Call macro3()
 
end sub


In excel 2007, you can hook driver() up to the Quick Access Toolbar under the Excel button, Excel Options, Customize.

under 'Choose commands from' combobox, pick Macros.
Add driver() (or whatever you name it)
change the icon if you want with the 'modify' button


In 2003, I can't quite remember. But I believe it's under Tools/options and there's a place you can hook up keyboard shortcuts or toolbar menu items. Sorry, i'm pretty foggy on that one these days.
 
Last edited:
Upvote 0
In 2003, right click in the grey area of the toolbar and select customize.
Select Commands / Macros in the left pane.
Drag a button from the right pane to your toolbar, now right click on it to modify and assign macros.
 
Upvote 0
Thank you to both of you.

I am starting with Excel 2003, so Michael how do I assign more than one macro so module to one toolbar icon. I only seem to be able to assign one?
 
Upvote 0
You can only assin one macro to each custom button, so...
Once you have followed my instruction in Post #3
You have a couple of choices.
1. Add more custom buttons and assisn macros to each one
2. Assign the driver() macro, mentioned by cappafrank to the button which calls the others
3. Rather than add custom buttons, add a custom menu instead and then add the custom buttons under that new menu.
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,460
Members
448,965
Latest member
grijken

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