Run 2 macros with OnAction

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
SIMPLEST WAY

Code:
sub RunBoth()
  macro1
  macro2
end sub

sub Macro1()
  beep
end sub

sub Macro2()
  beep
end sub

or put both macros in a BUTTON CLICK event.
 
Upvote 0
Strictly speaking, VBA is single-threaded, so two macros cannot run at the same time.

On the other hand, you are talking about execution with one call, which can be done using the previous example or by calling the next macro at the end of the first macro. You could probably combine the macros, but then there is only one macro.

I would encourage you to provide more detailed information so that we can help. It would be best if you could share the macros in question here.
 
Upvote 0
Thanks for advising, in the end I just had to call another Sub which combines the 2 macros, as it looks like there isn't another option.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

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