A
Arne Hegefors
I am redimming an array in a loop. I do not know in before hand how many
times the loop will run. the array must have the siame size as the number of
iterations in the loop. My problem is that I ReDim the array using the number
of iterations as upper boundary. However I get the error message "index
outside of interval". I do not understand how this can happen. Perhaps
someone can help me? Any help is appeciated! Thanks very much in advance!
Do Until IsEmpty(rngSecID.Offset(r, lngTypeColumn))
ReDim strMaturityArray(0 To r)
If rngSecID.Offset(r, lngTypeColumn).Text = strGovBond Then
strMaturityArray(r) = Mid(rngSecID.Offset(r, 0), InStr(InStr(1,
rngSecID.Offset(r, 0), " ") + 1, rngSecID.Offset(r, 0), " ") + 1, 4)
MsgBox strMaturityArray(r)
End If
r = r + 1
Loop
times the loop will run. the array must have the siame size as the number of
iterations in the loop. My problem is that I ReDim the array using the number
of iterations as upper boundary. However I get the error message "index
outside of interval". I do not understand how this can happen. Perhaps
someone can help me? Any help is appeciated! Thanks very much in advance!
Do Until IsEmpty(rngSecID.Offset(r, lngTypeColumn))
ReDim strMaturityArray(0 To r)
If rngSecID.Offset(r, lngTypeColumn).Text = strGovBond Then
strMaturityArray(r) = Mid(rngSecID.Offset(r, 0), InStr(InStr(1,
rngSecID.Offset(r, 0), " ") + 1, rngSecID.Offset(r, 0), " ") + 1, 4)
MsgBox strMaturityArray(r)
End If
r = r + 1
Loop