I'm really curious on this one. What version of Excel are you using?
Also, precisely what is the KB observation? Your code includes a VBA
array, not a worksheet array. I am using Excel 2002. The following
seems to work fine for me, with Row 5600 containing the values in the
first 9 columns, with the 9th column being the 3rd farthest populated one:
Sub FindNthFarthermostPopulatedColumn()
Dim arr() As Long
Dim i As Long, k As Long
Dim x%
ReDim arr(65535)
For i = 1 To 65535
If Application.CountA(Rows(i)) > 0 Then
k = k + 1
arr(k) = Cells(i, "IV").End(xlToLeft).Column
End If
Next
x = Application.Large(arr, 3) 'for 3rd farthest pop. column counting
'intervening blank columns
MsgBox "Column No. is " & x
End Sub
Alan Beban
Myles wrote:
> Alan,
>
> I altered 65536 ro 65535 with no relief.
>
> The 5460 limit was ascertained by trial and error-of course aided by
> the KB observation of such a ceiling.
>
> May be I will have to wait for the arrival of EXCEL 12 post beta.
>
>
> Myles
>
>
Bookmarks