View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Error'9': Can I create a msgbox for the user?

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


--
Hope that helps.

Vergel Adriano


"Dave M" wrote:

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?