Parece que você quer algo assim.
Private Sub ErrorHandlerDeveloper_Test()
Dim uErrorMsg As String
Dim devStatus As Boolean
devStatus = True ' Change to false when shared
'devStatus = False
Dim procName As String
procName = "ErrorHandlerDeveloper_Test"
On Error GoTo ErrorHandler
' *********************************
' code that triggers an error here
err.Raise 11
' *********************************
ExitRoutine:
Exit Sub
ErrorHandler:
If devStatus = True Then
err.Clear
On Error GoTo 0
' Return to the error line and highlight
Resume
Else
uErrorMsg = "Take note of this information and advise the developer." & vbCr & vbCr
'uErrorMsg = uErrorMsg & "Error Source...: " & Err.Source & vbCr & vbCr
uErrorMsg = uErrorMsg & "Procedure......: " & procName & vbCr & vbCr
uErrorMsg = uErrorMsg & "Error Number..: " & err.Number & vbCr & vbCr
uErrorMsg = uErrorMsg & "Description.....: " & err.Description
Debug.Print uErrorMsg
MsgBox uErrorMsg, , "Generated in " & procName
Resume ExitRoutine
End If
End Sub