Hey guys,
im trying to fill up my array and extended whenever needed:
And i hit the error: subscript out of range, why is it happening?
im trying to fill up my array and extended whenever needed:
Code:
arraySizeX = 1
arraySizeY = 2
ReDim Preserve orderArray(1 To arraySizeX, 1 To arraySizeY)
orderArray(1, 1) = "test"
orderArray(1, 2) = lastRow - 1
arraySizeX = arraySizeX + 1
ReDim Preserve orderArray(1 To arraySizeX, 1 To arraySizeY)
orderArray(2, 1) = "test2"
orderArray(2, 2) = Range("M2:M" & lastRow).Count
And i hit the error: subscript out of range, why is it happening?
Last edited: