Hello
I would like to store the values in two dimensional array as below;
Arr(0,0)="test1", Arr(0,1)="test2", Arr(0,2)="test3"....
Arr (1,0)="test1". Arr(1,1)="va1", Arr(1,2)="test3"...
.........
so I written code as below
Dim Arr() as Variant
Dim Counter as Long
Counter =0
Do while (some condition)
redim preserve Arr(Counter, 0)
Arr(Counter, 0)="test1"
redim preserve Arr(Counter, 1)
Arr(Counter, 1)="test1"
redim preserve Arr(Counter, 2)
Arr(Counter, 2)="test2"
Counter = Counter +1
loop
But when it finishes the first loop and goes second time the below line gives error.
redim preserve Arr(Counter, 0) ..> subscription out of range
Please assist what is wrong
I would like to store the values in two dimensional array as below;
Arr(0,0)="test1", Arr(0,1)="test2", Arr(0,2)="test3"....
Arr (1,0)="test1". Arr(1,1)="va1", Arr(1,2)="test3"...
.........
so I written code as below
Dim Arr() as Variant
Dim Counter as Long
Counter =0
Do while (some condition)
redim preserve Arr(Counter, 0)
Arr(Counter, 0)="test1"
redim preserve Arr(Counter, 1)
Arr(Counter, 1)="test1"
redim preserve Arr(Counter, 2)
Arr(Counter, 2)="test2"
Counter = Counter +1
loop
But when it finishes the first loop and goes second time the below line gives error.
redim preserve Arr(Counter, 0) ..> subscription out of range
Please assist what is wrong