For static array, we do this:
Dim arr(10) as variant
If we are not sure of the array size, we do this:
Dim arr()
Redim arr(1 to Some_number)
Or
Redim preserve arr(Some_number)
As you can see, we always need to tell excel beforehand how big the array will be before putting in values.
But, if the values I am going to put in my array are cells (Ranges), then I do not need to define the array size, we put in values directly.
Dim arr()
arr = Range("A1:B100")
Anyone one knows the reason?
Thank you!