View Single Post
  #26   Report Post  
Alan Beban
 
Posts: n/a
Default

Alan Beban wrote:
Harlan Grove wrote:

Alan Beban wrote...
...

The problem is with the built-in INDEX function; it fails if the array
or reference contains more than 65536 elements.




Are you sure there isn't a problem with 65,536 elements? I'd suspect it
chokes after 65,535 elements. . . .



Dim arr, i
ReDim arr(1 To 65536)
For i = 1 To 65536
arr(i) = i * 2
Next
MsgBox Application.Index(arr, 65536) <----displays 131072 in xl2002.

In xl2000 and earlier it fails on 5462 elements or greater.

Alan Beban


Although on the worksheet =INDEX(A:B, 65536,2) works fine (in either
xl2000 or xl2002).

Alan Beban