nonexisting array-element null value ?
Hello girls and others,
Now I have a problem with an (nonexisting) array-element null value (how to get it?).
If i have for instance a 2dimensional array testArray(2, 2) , i need something like:
Sub TestSub()
If testArray(5, 3) = Null Then
MsgBox "Success"
End if
End Sub
but i get error message : "Run-time error '9': Subscript out of range"
Actually, here is an entire test code:
Code:
Dim testArray() As Integer 'global
Sub Fill()
Dim k As Integer
Dim w As Integer
k = 100
w = 200
For t = 0 To 3
ReDim Preserve testArray(2, t)
testArray(0, t) = k
testArray(1, t) = w
MsgBox testArray(0, t) 'works
MsgBox testArray(1, t) 'works
k = k + 1
w = w + 1
Next t
Call TestSub
End Sub
Sub TestSub()
If testArray(5, 3) = Null Then
MsgBox "Yeah"
End If
End Sub
"Run-time error '9': Subscript out of range" :wot
Thanks