Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Application.Match

I'm trying to use

var = Application.Match(value,arr,0) and
var2 = Application.Match(value,arr)

but I notice that when I go to type in the
formula in VBA, I'm not seeing .Match as a choice.
When I run the code I'm getting a type mismatch...

Thoughts?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Application.Match

If you have the statement

Dim ColumnVector(1 to 20000, 1 to 1)

this is a 2-dim array. The Dim statement for a 1-Dim array looks like this:

Dim ColumnVector(1 To 20000)

How did you load ColumnVector? From a worksheet? If so, it should work.


On 1 Sep 2004 16:07:44 -0700, "
wrote:

I just checked again -

the item to be matched is a Variant/String and the
array coming out of ColumnVector is also a Variant/String

The odd thing is when I do a "watch" on Column Vector I see the
folowing

(-) ColumnVector Variant/Variant(1 to
20000,1 to 1)
(-) ColumnVector(1) Variant(1 to 1)
ColumnVector(1,1) "100" Variant/String
(+) ColumnVector(2)
.
.
.



(+) ColumnVector(20000)

Is it possible that the Match is having problem because it sees the
item to be matched as a Varient/String and the columnvector as
Variant(1 to 1)


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Application.Match

What version of Excel Marston? As stated in response to a previous
question, if using Excel 2000 or earlier, Application.Match will not work
with an array that has more than 5461 elements. And the response/error it
Type Mismatch.

--
Regards,
Tom Ogilvy

"Myrna Larson" wrote in message
...
If you have the statement

Dim ColumnVector(1 to 20000, 1 to 1)

this is a 2-dim array. The Dim statement for a 1-Dim array looks like

this:

Dim ColumnVector(1 To 20000)

How did you load ColumnVector? From a worksheet? If so, it should work.


On 1 Sep 2004 16:07:44 -0700, "
wrote:

I just checked again -

the item to be matched is a Variant/String and the
array coming out of ColumnVector is also a Variant/String

The odd thing is when I do a "watch" on Column Vector I see the
folowing

(-) ColumnVector Variant/Variant(1 to
20000,1 to 1)
(-) ColumnVector(1) Variant(1 to 1)
ColumnVector(1,1) "100" Variant/String
(+) ColumnVector(2)
.
.
.



(+) ColumnVector(20000)

Is it possible that the Match is having problem because it sees the
item to be matched as a Varient/String and the columnvector as
Variant(1 to 1)




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Application.Match

Tom Ogilvy wrote:
What version of Excel Marston? As stated in response to a previous
question, if using Excel 2000 or earlier, Application.Match will not work
with an array that has more than 5461 elements. And the response/error it
Type Mismatch.


There's no problem with Application.Match; I think you may be recalling
a problem with Application.Index.

I.e., Application.Match(value,Index(arr,0,1),0) won't work in xl2000 for
arr more than 5461 elements. But

Application.Match(value,ColumnVector(arr,1),0) will because it doesn't
depend on the Index function.

Alan Beban


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Application.Match

Alan Beban wrote:

Tom Ogilvy wrote:

What version of Excel Marston? As stated in response to a previous
question, if using Excel 2000 or earlier, Application.Match will not work
with an array that has more than 5461 elements. And the
response/error it
Type Mismatch.


There's no problem with Application.Match; I think you may be recalling
a problem with Application.Index.

I.e., Application.Match(value,Index(arr,0,1),0) won't work in xl2000 for
arr more than 5461 elements. But

Application.Match(value,ColumnVector(arr,1),0) will because it doesn't
depend on the Index function.

Alan Beban

Bite my tongue, Tom. Application.Match *is* subject to the 5461 element
limit.

I tested on a 2 column range. E.g.,
arr=Range("a1:b2730")
x=Application.Match(value,Application.Index(arr,0, 1),0)
This works, but fails when 2730 is change to 2731 because *arr* then has
5462 elements.
x=Application.Match(value,ColumnVector(arr,1),0) works for 2730 *and*
for 2731, which led me to my wrong conclusion; it works until the 2730
is increased beyond 5461 and then fails because the *column* has more
than the 5461 element limit.

My apologies,
Alan Beban
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
application.match and value problem Cbrehm Excel Discussion (Misc queries) 0 February 12th 11 04:34 PM
Office application version does not match. Joy Excel Discussion (Misc queries) 0 February 16th 09 01:22 PM
application.match Chip Smith Excel Discussion (Misc queries) 3 March 30th 06 08:56 PM
Application.Match with Times Pat[_11_] Excel Programming 7 January 12th 04 02:34 PM
Application.Match with Times Pat[_12_] Excel Programming 0 January 11th 04 02:16 AM


All times are GMT +1. The time now is 12:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"