Conditional Macro calling within Macro

Grange2

New Member
Joined
Mar 31, 2021
Messages
14
Office Version
  1. 2013
  2. 2011
Platform
  1. Windows
Hello,

i have set up a macro that will call on other macros however would like to set up an if condition if one of the first macros runs into an error.

Say Macro 1 is the Initial Macro that is run that calls on Macro 2.
If during Macro 1 it calls on Macro 2 and it runs into an error how do you code for it to call on Macro 3 in this instance?

Any help would be appreciated!

Thank you,
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Maybe this :
VBA Code:
Sub One()
Call Two
End Sub

Sub Two()
On Error GoTo e
'Your code
e: Call Three
End Sub

Sub Three()
'Your code
End Sub

But of course, the result of any actions carried by macro Three before an error will remain.
 
Upvote 0
Correction :
"But of course, the result of any actions carried by macro Two before an error will remain."
 
Upvote 0
Solution

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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