I have a 2 dimensional array. I wanted to make a redim preserve on it's first dimension but I know that redim preseve works only on the last dimension. I tried to use transpose function, but it seems that the transpose is changing my array from base 0 to base 1, is it normal ? if yes how to set it back to base 0 ? or how to solve my problem to preserve my array while changing it's first dimension ? I want to add 2 elements to my array
here is a part of my code where I get the problem :
table3 = Application.Transpose(table3)
ReDim Preserve table3(Ubound(table3,1), Ubound(table3,2) +2)
table3 = Application.Transpose(table3)
I noticed that before the Transpose the array is base 0 and after the transpose it's base 1, and I think that's the main problem. I don't want to change the base from 0 to 1 because I use the same array elsewhere in my code and I don't want to change the whole code.
The following line of code will give me an error
“Subscript Out of Range”
ReDim Preserve table3(Ubound(table3,1), Ubound(table3,2) +2)
if I change it by the following line
ReDim Preserve table3(1 To UBound(table3, 1), UBound(table3, 2) + 2)
it will work but my array will become a based 1 array which not what I want, I want to keep my indexes starts from 0 not from 1
BEFORE TRANSPOSE
AFTER TRANSPOSE