Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm going nuts trying to solve the following problem. If I execute the following code when the active sheet has no named ranges, the first error is trapped successfully, but the second one does not get trapped and the execution breaks! Sub MySub() Dim r as Range Dim isA as Boolean Dim isB as Boolean isA = False isB = False TryA: On Error GoTo TryB Set r = ActiveSheet.Range("AAA") isA= True GoTo Proceed TryB: On Error GoTo Proceed Set r = ActiveSheet.Range("BBB") isB = True GoTo Proceed Proceed: If isAThen doAStuff ElseIf isB Then doBStuff End If End Sub Perhaps it's invalid to have 2 "On Error" statements? In any case, I will really appreciate your help! Bura |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting instances of found text (Excel error? Or user error?) | Excel Worksheet Functions | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Error trapped only while stepping through the code - Not triggered when run | Excel Discussion (Misc queries) | |||
Can error 1004 be trapped???? | Excel Programming |