If you step through the code and have the Locals Window open (View -> Locals) you will find that the Variant Array will be listed as
although there is only 1 column the Array is still 2-dimensional...
and though
will return 5 this is because with UBound function the Dimension parameter is optional (default of 1st dimension).
However, when referencing a specific point within the 2 dimensional array, eg:
you will need to specify values for both dimensions
If you were to transpose the Horizontal source range twice when first populating the variant array, ie:
You will find vHdrs becomes a single dimension array
at which point
would work (and the 2 dimensional syntax would not)
I would confess Arrays are not a strong point of mine and I've no doubt someone here can explain the above more thoroughly for you... if they're willing ...
Bookmarks