Public Sub Foo() On Error Goto Foo_Err ' some code goes here Exit Sub Foo_Err: ' Error handling code goes here End Sub