View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Array size limit

You code worked ok for me also.
One small idea would be to search 256 columns, vs. 64000 Rows.

Sub Demo()
Dim Col As Collection
Dim C As Long
Dim n As Long

Set Col = New Collection
ActiveSheet.UsedRange
For C = 1 To Cells.SpecialCells(xlCellTypeLastCell).Column
n = WorksheetFunction.CountA(Columns(C))
If n 0 Then Col.Add C, CStr(C)
Next
MsgBox Col(Col.Count - 2)
End Sub

There are other ways with "Find", but this was quick n dirty.
--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Myles" wrote in
message ...

i was just wondering if it was the amount of memory limiting you to that
number of elements

Yes and No! Yes because there is an inherent constraint in Excel which
does not allow you to exceed that magic number of 5460. In that wise,
Excel's resources put a break on how far you can go.

On the other hand, as you well know, there are instances where an
operation is not subjected to any computational limitation per se
except of course limitation imposed by available "system resources"
which vary from one window version to another, to say nothing of
varying hardware specifications.
The Array limit is a defined limit and is not governed by overall
resource bank


Myles


--
Myles
------------------------------------------------------------------------
Myles's Profile:
http://www.excelforum.com/member.php...o&userid=28746
View this thread: http://www.excelforum.com/showthread...hreadid=571892