Multiple error handling

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,189
I am trying to handle multiple errors and am a bit surprised the following actually works:

Rich (BB code):
    On Error Goto Errhandler

        ' Do something

Exitpoint:

    On Error GoTo 0 ' OK this line is not actually needed.

    Exit Sub

ErrHandler:

    On Error Resume Next

        'Do something

    On Error GoTo 0 ' Since this line resets the error handling action, why does the resume statement work?

    Resume Exitpoint
I am puzzled by this line:

Rich (BB code):
On Error GoTo 0 ' Since this line resets the error handling action, why does the resume statement work?


Can someone please explain.

Thanks


 
Last edited:

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,791
Office Version
365
Platform
Windows
You're welcome
 

Watch MrExcel Video

Forum statistics

Threads
1,099,252
Messages
5,467,557
Members
406,543
Latest member
semoredhawk

This Week's Hot Topics

Top