On Error GoTo -1
This statement resets the Err Object AND resets/clears the VBA Error memory.
In most situations On Error GoTo -1 does exactly the same as Err.Clear although there is a subtle difference.
Using Line Labels
This statement can be used to allow multiple errors to be handled using line labels in the same subroutine.
This is not recommended because having multiple line labels is confusing to debug.
If you replace "On Error GoTo -1" with "Err.Clear" you will see different results.
Using Err.Clear will display the error message but On Error GoTo -1 will reset everything so the second error handler will work.
Using Resume Next
The Err.Clear method can be used to allow multiple errors to be handled using Resume Next in the same subroutine.
This is not recommended because there is a risk of catching the previously handled error.
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext