tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
Is it good practice to always follow an on error with a resume?
For example, method 1:
or will method 2 suffice?
Thanks
For example, method 1:
Code:
Sub Start()
On Error GoTo Errhandler
a = 0
b = 10 / a
On Error GoTo 0
' do something
Terminate:
On Error GoTo 0
Exit Sub
Errhandler:
Msgbox "Div by 0"
Resume Terminate
End Sub
or will method 2 suffice?
Code:
Sub Start()
On Error GoTo Errhandler
a = 0
b = 10 / a
On Error GoTo 0
' do something
GoTo Terminate
Errhandler:
Msgbox "Div by 0"
Terminate:
On Error GoTo 0
End Sub
Thanks