I don't think there is a way to retrieve the name via code. But if you handle the errors within your subs/functions, then you copuld do this:
Code:
Private Sub MyFirstSub1()
On Error Goto ErrHandler
'...Regular sub code comes here...
Exit Sub
ErrHandler:
MsgBox Err.Number & ": " & Err.Description & vbCrLf & "MyFirstSub1" & ", " & Me.Name
End Sub
Private Function AnotherFunction34() As String
On Error Goto ErrHandler
'...Regular function code comes here...
Exit Function
ErrHandler:
MsgBox Err.Number & ": " & Err.Description & vbCrLf & "AnotherFunction34" & ", " & Me.Name
End Function
Private Sub MyOtherCoolSub()
On Error Goto ErrHandler
'...Regular sub code comes here...
Exit Sub
ErrHandler:
MsgBox Err.Number & ": " & Err.Description & vbCrLf & "MyOtherCoolSub" & ", " & Me.Name
End Sub
Since you know the names of your subs/functions you can just store them at design-time.