tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,907
- Office Version
- 365
- 2019
- Platform
- Windows
I have added an error handling in the code below.
Suppose MyArray(10, 1) = #NA, then the error handling works but if MyArray(11, 1) = #NA also, it fails.
It seems the error handling cannot handle more than one error. How can I fix this? I have even added an On Error GoTo 0 to "reset" it but it still doesn't work.
Suppose MyArray(10, 1) = #NA, then the error handling works but if MyArray(11, 1) = #NA also, it fails.
It seems the error handling cannot handle more than one error. How can I fix this? I have even added an On Error GoTo 0 to "reset" it but it still doesn't work.
Code:
Dim a As Integer
a = 1
On Error Goto ErrHandler
For b = 1 To 100
Do Until MyArray(a, 1) = 100
a = a + 1
Loop
Continue:
Next b
Exit Sub
ErrHandler:
MsgBox "Error"
On Error GoTo 0
GoTo Continue