n3olcsatok
New Member
- Joined
- Jun 7, 2011
- Messages
- 5
Hi All!
I was trying to use a dynamic, 2 dimensional array. I know full well that only the last dimension can be sized, so I used the following code:
The strange thing is, I get a Subscript out of range error upon first execution at the ReDim Preserve, yet in another bunch of code this worked perfectly. Do you have any ideas what may have gone wrong?
I was trying to use a dynamic, 2 dimensional array. I know full well that only the last dimension can be sized, so I used the following code:
Code:
ReDim pFields(1 To 2, 1)
pExtent = 1
Do While Not IsEmpty(vTable.Cells(pExtent, 1))
ReDim Preserve pFields(1 To 2, 1 To pExtent)
'other stuff
pExtent = pExtent + 1
Loop
The strange thing is, I get a Subscript out of range error upon first execution at the ReDim Preserve, yet in another bunch of code this worked perfectly. Do you have any ideas what may have gone wrong?