Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Error'9': Can I create a msgbox for the user?

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error'9' Subscript out of range. How do I sort? Please [email protected] Excel Discussion (Misc queries) 1 October 13th 07 10:19 PM
How to create a MsgBox to alert user an invalid entry has been mad TimN Excel Programming 2 July 21st 06 02:45 PM
User defined msgbox Brian Matlack[_34_] Excel Programming 1 December 14th 05 08:09 PM
allow user to change workbook while in Msgbox or InputBox [email protected] Excel Programming 1 March 22nd 05 02:33 AM
MsgBox and User Input Terrin Excel Programming 2 September 9th 03 09:05 PM


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"