A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
It probably don't even have to be a function - that's just how Craig implementeted it...
You could also just make a normal Sub/macro in a normal code module with something like this:
Sub MyErrorRoutine ( ErrorCode, SubName , SendMail )
...Your error macro here...
End Sub
And, then call this macro with something like:
Call MyErrorRoutine ( Err.Number , "MyMacro" , True )
In each macro, your would have to have something like:
On Error GoTo ErrorHandler:
...at the begining of the Sub/macro.
And, your error handler could then be just that code line:
ErrorHandler:
Call MyErrorRoutine ( Err.Number , "MyMacro" , True )
...at the end of the Sub/macro (maybe after an 'Exit Sub')