Originally Posted by
malik641
Hey everyone,
This is annoying, and I can't find this on the web...or in help files. Not sure if I'm not looking in the right places. But could someone help me with this code?
[vba]Sub test_Array()
Dim varArray() As Variant
Dim i As Integer
For i = 0 To 9
'ReDim Preserve varArray(UBound(varArray, 1) + 1, 1)
'ReDim Preserve varArray(i, 1)
varArray(i, 0) = i
varArray(i, 1) = i * i
Next
End Sub[/vba]
I keep getting a "Subscript out of range" error with the two commented out lines (just two methods I tried).
Any suggestions?