this is typically how it goes:
Code:
Private Sub SoSomething()
On Error GoTo errHandler
'Do some stuff that may cause an error
Exit Sub 'Exit the sub before falling into the error handler
errHandler:
'Handle the error here
End Sub
Alternatively....
Code:
Private Sub SoSomething()
On Error GoTo errHandler
'Do some stuff that may cause an error
DoCleanup:
' Do stuff to clean up before exiting
Exit Sub 'Exit the sub before falling into the error handler
errHandler:
'Handle the error here
Resume DoCleanup 'resume at the cleanup before exiting
End Sub
-tg