PC Review


Reply
Thread Tools Rate Thread

5461 element limit

 
 
Alan Beban
Guest
Posts: n/a
 
      4th Apr 2005
In xl2000 there is a limit of 5461 elements on the efficacy of many
worksheet functions used in VBA code. Has that limit been changed in
later versions of Excel?

Thanks,
Alan Beban
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      4th Apr 2005
I remember that xl2002 removed the 5461 limit in application.transpose. And
it's still gone in xl2003:

Option Explicit
Sub testme()
Dim myArr As Variant

With ActiveSheet.Range("a1:a65536")
.Formula = "=row()"
.Value = .Value
myArr = .Value
End With

With Application
myArr = .Transpose(.Transpose(myArr))
End With

Debug.Print UBound(myArr)

End Sub

showed:
65536
in the immediate window.

Do you have a particular function you're concerned about?


Alan Beban wrote:
>
> In xl2000 there is a limit of 5461 elements on the efficacy of many
> worksheet functions used in VBA code. Has that limit been changed in
> later versions of Excel?
>
> Thanks,
> Alan Beban


--

Dave Peterson
 
Reply With Quote
 
Alan Beban
Guest
Posts: n/a
 
      4th Apr 2005
Thanks, Dave,

INDEX, MATCH and VLOOKUP were other affected functions.

Alan Beban

Dave Peterson wrote:
> I remember that xl2002 removed the 5461 limit in application.transpose. And
> it's still gone in xl2003:
>
> Option Explicit
> Sub testme()
> Dim myArr As Variant
>
> With ActiveSheet.Range("a1:a65536")
> .Formula = "=row()"
> .Value = .Value
> myArr = .Value
> End With
>
> With Application
> myArr = .Transpose(.Transpose(myArr))
> End With
>
> Debug.Print UBound(myArr)
>
> End Sub
>
> showed:
> 65536
> in the immediate window.
>
> Do you have a particular function you're concerned about?
>
>
> Alan Beban wrote:
>
>>In xl2000 there is a limit of 5461 elements on the efficacy of many
>>worksheet functions used in VBA code. Has that limit been changed in
>>later versions of Excel?
>>
>>Thanks,
>>Alan Beban

>
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      5th Apr 2005
I don't recall those functions exhibiting this problem.

But I tried this:

Option Explicit
Sub testme()
Dim myArr As Variant
Dim res As Variant

With ActiveSheet.Range("a1:b65536")
.Formula = "=row()"
.Value = .Value

res = Application.Index(.Range("a:a"), 65500)

Debug.Print "---.index---"
If IsError(res) Then
Debug.Print CStr(res)
Else
Debug.Print res
End If

res = Application.VLookup(65500, .Range("a:b"), 2, False)

Debug.Print "---.vlookup---"
If IsError(res) Then
Debug.Print CStr(res)
Else
Debug.Print res
End If

res = Application.Match(65500, .Range("a:a"), 0)

Debug.Print "---.match---"
If IsError(res) Then
Debug.Print CStr(res)
Else
Debug.Print res
End If

End With

End Sub

and got this:
---.index---
65500
---.vlookup---
65500
---.match---
65500

And using the array:

Option Explicit
Sub testme()
Dim myArr As Variant
Dim res As Variant

With ActiveSheet.Range("a1:b65536")
.Formula = "=row()"
.Value = .Value
myArr = .Value
End With

With Application
res = .Match(65500, .Index(myArr, 0, 1), 0)
Debug.Print "---.match & .index---"
If IsError(res) Then
Debug.Print CStr(res)
Else
Debug.Print res
End If
End With

End Sub

I got:

---.match & .index---
65500

=========
Did I get close to what you were looking for?

If no, if you have some code, I can paste it in and test it out.

Alan Beban wrote:
>
> Thanks, Dave,
>
> INDEX, MATCH and VLOOKUP were other affected functions.
>
> Alan Beban
>
> Dave Peterson wrote:
> > I remember that xl2002 removed the 5461 limit in application.transpose. And
> > it's still gone in xl2003:
> >
> > Option Explicit
> > Sub testme()
> > Dim myArr As Variant
> >
> > With ActiveSheet.Range("a1:a65536")
> > .Formula = "=row()"
> > .Value = .Value
> > myArr = .Value
> > End With
> >
> > With Application
> > myArr = .Transpose(.Transpose(myArr))
> > End With
> >
> > Debug.Print UBound(myArr)
> >
> > End Sub
> >
> > showed:
> > 65536
> > in the immediate window.
> >
> > Do you have a particular function you're concerned about?
> >
> >
> > Alan Beban wrote:
> >
> >>In xl2000 there is a limit of 5461 elements on the efficacy of many
> >>worksheet functions used in VBA code. Has that limit been changed in
> >>later versions of Excel?
> >>
> >>Thanks,
> >>Alan Beban

> >
> >


--

Dave Peterson
 
Reply With Quote
 
Alan Beban
Guest
Posts: n/a
 
      5th Apr 2005
Dave Peterson wrote:
> I don't recall those functions exhibiting this problem.


Oh yes, indeed. Thanks for the code below. Another that doesn't work
in xl2000 because of the limit would be

res = .Vlookup(65500, myArr, 2, False)

Thanks again,
Alan Beban

>
> But I tried this:
>
> Option Explicit
> Sub testme()
> Dim myArr As Variant
> Dim res As Variant
>
> With ActiveSheet.Range("a1:b65536")
> .Formula = "=row()"
> .Value = .Value
>
> res = Application.Index(.Range("a:a"), 65500)
>
> Debug.Print "---.index---"
> If IsError(res) Then
> Debug.Print CStr(res)
> Else
> Debug.Print res
> End If
>
> res = Application.VLookup(65500, .Range("a:b"), 2, False)
>
> Debug.Print "---.vlookup---"
> If IsError(res) Then
> Debug.Print CStr(res)
> Else
> Debug.Print res
> End If
>
> res = Application.Match(65500, .Range("a:a"), 0)
>
> Debug.Print "---.match---"
> If IsError(res) Then
> Debug.Print CStr(res)
> Else
> Debug.Print res
> End If
>
> End With
>
> End Sub
>
> and got this:
> ---.index---
> 65500
> ---.vlookup---
> 65500
> ---.match---
> 65500
>
> And using the array:
>
> Option Explicit
> Sub testme()
> Dim myArr As Variant
> Dim res As Variant
>
> With ActiveSheet.Range("a1:b65536")
> .Formula = "=row()"
> .Value = .Value
> myArr = .Value
> End With
>
> With Application
> res = .Match(65500, .Index(myArr, 0, 1), 0)
> Debug.Print "---.match & .index---"
> If IsError(res) Then
> Debug.Print CStr(res)
> Else
> Debug.Print res
> End If
> End With
>
> End Sub
>
> I got:
>
> ---.match & .index---
> 65500
>
> =========
> Did I get close to what you were looking for?
>
> If no, if you have some code, I can paste it in and test it out.
>
> Alan Beban wrote:
>
>>Thanks, Dave,
>>
>>INDEX, MATCH and VLOOKUP were other affected functions.
>>
>>Alan Beban
>>
>>Dave Peterson wrote:
>>
>>>I remember that xl2002 removed the 5461 limit in application.transpose. And
>>>it's still gone in xl2003:
>>>
>>>Option Explicit
>>>Sub testme()
>>> Dim myArr As Variant
>>>
>>> With ActiveSheet.Range("a1:a65536")
>>> .Formula = "=row()"
>>> .Value = .Value
>>> myArr = .Value
>>> End With
>>>
>>> With Application
>>> myArr = .Transpose(.Transpose(myArr))
>>> End With
>>>
>>> Debug.Print UBound(myArr)
>>>
>>>End Sub
>>>
>>>showed:
>>>65536
>>>in the immediate window.
>>>
>>>Do you have a particular function you're concerned about?
>>>
>>>
>>>Alan Beban wrote:
>>>
>>>
>>>>In xl2000 there is a limit of 5461 elements on the efficacy of many
>>>>worksheet functions used in VBA code. Has that limit been changed in
>>>>later versions of Excel?
>>>>
>>>>Thanks,
>>>>Alan Beban
>>>
>>>

>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      5th Apr 2005
I guess I was always lucky enough to use ranges in that kind of
application.vlookup() in earlier versions.



Alan Beban wrote:
>
> Dave Peterson wrote:
> > I don't recall those functions exhibiting this problem.

>
> Oh yes, indeed. Thanks for the code below. Another that doesn't work
> in xl2000 because of the limit would be
>
> res = .Vlookup(65500, myArr, 2, False)
>
> Thanks again,
> Alan Beban
>
> >
> > But I tried this:
> >
> > Option Explicit
> > Sub testme()
> > Dim myArr As Variant
> > Dim res As Variant
> >
> > With ActiveSheet.Range("a1:b65536")
> > .Formula = "=row()"
> > .Value = .Value
> >
> > res = Application.Index(.Range("a:a"), 65500)
> >
> > Debug.Print "---.index---"
> > If IsError(res) Then
> > Debug.Print CStr(res)
> > Else
> > Debug.Print res
> > End If
> >
> > res = Application.VLookup(65500, .Range("a:b"), 2, False)
> >
> > Debug.Print "---.vlookup---"
> > If IsError(res) Then
> > Debug.Print CStr(res)
> > Else
> > Debug.Print res
> > End If
> >
> > res = Application.Match(65500, .Range("a:a"), 0)
> >
> > Debug.Print "---.match---"
> > If IsError(res) Then
> > Debug.Print CStr(res)
> > Else
> > Debug.Print res
> > End If
> >
> > End With
> >
> > End Sub
> >
> > and got this:
> > ---.index---
> > 65500
> > ---.vlookup---
> > 65500
> > ---.match---
> > 65500
> >
> > And using the array:
> >
> > Option Explicit
> > Sub testme()
> > Dim myArr As Variant
> > Dim res As Variant
> >
> > With ActiveSheet.Range("a1:b65536")
> > .Formula = "=row()"
> > .Value = .Value
> > myArr = .Value
> > End With
> >
> > With Application
> > res = .Match(65500, .Index(myArr, 0, 1), 0)
> > Debug.Print "---.match & .index---"
> > If IsError(res) Then
> > Debug.Print CStr(res)
> > Else
> > Debug.Print res
> > End If
> > End With
> >
> > End Sub
> >
> > I got:
> >
> > ---.match & .index---
> > 65500
> >
> > =========
> > Did I get close to what you were looking for?
> >
> > If no, if you have some code, I can paste it in and test it out.
> >
> > Alan Beban wrote:
> >
> >>Thanks, Dave,
> >>
> >>INDEX, MATCH and VLOOKUP were other affected functions.
> >>
> >>Alan Beban
> >>
> >>Dave Peterson wrote:
> >>
> >>>I remember that xl2002 removed the 5461 limit in application.transpose. And
> >>>it's still gone in xl2003:
> >>>
> >>>Option Explicit
> >>>Sub testme()
> >>> Dim myArr As Variant
> >>>
> >>> With ActiveSheet.Range("a1:a65536")
> >>> .Formula = "=row()"
> >>> .Value = .Value
> >>> myArr = .Value
> >>> End With
> >>>
> >>> With Application
> >>> myArr = .Transpose(.Transpose(myArr))
> >>> End With
> >>>
> >>> Debug.Print UBound(myArr)
> >>>
> >>>End Sub
> >>>
> >>>showed:
> >>>65536
> >>>in the immediate window.
> >>>
> >>>Do you have a particular function you're concerned about?
> >>>
> >>>
> >>>Alan Beban wrote:
> >>>
> >>>
> >>>>In xl2000 there is a limit of 5461 elements on the efficacy of many
> >>>>worksheet functions used in VBA code. Has that limit been changed in
> >>>>later versions of Excel?
> >>>>
> >>>>Thanks,
> >>>>Alan Beban
> >>>
> >>>

> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any Way to Limit Instances of a Web User Control Element? Jonathan Wood Microsoft ASP .NET 6 5th May 2009 12:43 AM
Element 'Element Name Here' is not a known element. This can occur if there is a compilation error in the Web M Noreen Microsoft Dot NET 3 17th Apr 2006 07:28 AM
possible until 5461 tom taol Microsoft Excel Programming 4 31st Jan 2005 11:08 PM
requests limit for trace element Freddy Microsoft ASP .NET 0 24th Mar 2004 10:09 AM
requests limit for trace element Freddy Microsoft ASP .NET 1 23rd Mar 2004 11:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:46 PM.