View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default another array approach question

To find the number of "rows"
msgbox ubound(arr,1) - lbound(arr,1) + 1

To find the number of "columns" in that array:
msgbox ubound(arr,2) - lbound(arr,2) + 1

If you want the total elements, just multiply these two.



Gary Keramidas wrote:

let's see if i can explain clearly.

i'm using this to initialize the array
ReDim arr(0 To 1, 0 To 0)

then i use a redim preserve to add the elements

how can i tell how many elements there are to loop through?

ubound(arr) returns 1 and i know there are more elements than that.

--

Gary


--

Dave Peterson