snb has a nice writeup on arrays

https://www.snb-vba.eu/VBA_Arrays_en.html

As an aside, it the PP macro I used Redim Preserve on the dynamic array which just 'adjusts' the array size so that it could be passed to Range(..)

Depending on how it will be used, I also sometimes will Dim a fixed array and use a counter



Dim Ary(1 to 1000) as long
dim cntAry as long

cntAry = 0

...
...
...
...

cntAry = cntAry + 1
Ary(cntArt) = 12345

...
...
...

LastVal = Ary(cntAry)