Error'9': Can I create a msgbox for the user?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am getting an Error '9'. I know why this is happening, but the user will
not. Is there a way that I can show a msg box instead of the errorcode?
 
Dave,

If you have error handlers in your code, you'd be able to show a different
message for the user. for example:

Sub test()
On Error GoTo Error_Handler

Dim i(2) As Integer

i(3) = 3

Exit Sub

Error_Handler:
Select Case Err.Number
Case 9: MsgBox "Subscript out of range!"
Case Else: MsgBox "An unexpected error occurred!"
End Select
End Sub
 
Back
Top