IDE - just a thought on Next and Out of Subscript
#2
On Error might catch your subscript error and you could message box the index values then?

When subscript out of range: #1 cause for me is that I am using index twice (two different ways) usually an i variable, specially likely in huge amount of code.

Code: (Select All)
On Error GoTo ehandle
Dim a(1 To 15)
For i = 1 To 20
    a(i) = i ' error at i = 16
Next
End

ehandle:
Print i
Print "Error: "; Err
End

I got error code 9 a general error code?

I try and look up Error codes in Wiki and no numbers = error descriptions are listed under Error codes.
b = b + ...
Reply


Messages In This Thread
RE: IDE - just a thought on Next and Out of Subscript - by bplus - 05-14-2023, 03:59 PM



Users browsing this thread: 5 Guest(s)