tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
Which of the two methods below are preferable?
Method1 with error handling:
or Method2, skipping over errrors?
Thanks
Method1 with error handling:
Code:
Sub Start()
On Error GoTo Errhandler
For Counter = 1 To 1000
i = 1
Do Until TableArray(i, 1) = MyArray(j, 1)
i = i + 1
Loop
NextCounter:
j = j + 1
Next Counter
Exit Sub
Errhandler:
Resume NextCounter
End sub
or Method2, skipping over errrors?
Code:
Sub Start2()
On Error Resume Next
For Counter = 1 To 1000
i = 1
Do Until TableArray(i, 1) = MyArray(j, 1)
i = i + 1
Loop
j = j + 1
Next Counter
End Sub
Thanks