View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_3_] Alan Beban[_3_] is offline
external usenet poster
 
Posts: 130
Default size of multidimensional dynamic array

Typically,

for 1-dimensional arrays:
iSize=UBound(arr) - LBound(arr) + 1

for 2-dimensional arrays:
iSize = (UBound(arr, 1) - LBound(arr, 1) + 1) * _
(UBound(arr, 2) - LBound(arr, 2) + 1)

Alan Beban

ThatFella wrote:
-Originally posted by Alan Beban -

<snip

then gInfo is not an array of arrays, and you should change gInfo(1)
to
gInfo,2.

Alan Beban



Guess I haven't read the documentation of UBound recently.
UBound(gInfo, 2) is what I was looking for. Thanks!

In response to your comment about size, I didn't really care which way
it was taken; either answer would have sufficed, but I'll be more
precise next time. But since you bring it up, how DO you get actual
length of the array (not UBound)? Thanks.