Run 2 macros with OnAction

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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