Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default USing Match on 2D array

Got it.

Application.Match(x, Application.Index(OrigViewNames, 0, 1), 1)



"ExcelMonkey" wrote:

Can someone please remind me how to use match on a 2d array ("OrigViewNames")
if i am looking to return the position of a value (x) in the second column of
the array.

This does not work:
Application.Match(x, OrigViewNames, 0)

What do I have to put after the OrigViewNames to indicate column 2.

Thanks

EM

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default USing Match on 2D array

Hopefully you have discovered by now that that matches on column 1 of the
array, not column 2 as you asked.

Sub abc()
Dim v As Variant
ReDim v(0 To 3, 0 To 1)
For i = 0 To 3
v(i, 0) = i + 1
v(i, 1) = Chr(i + 65)
Next
x = "C"
res = Application.Match(x, Application.Index(v, 0, 2), 1)
Debug.Print res, Application.Index(v, res, 2)
End Sub


Produces

3 C

for me. (3 being the index into the second column of the 2D array. )

--
Regards,
Tom Ogilvy


"ExcelMonkey" wrote:

Got it.

Application.Match(x, Application.Index(OrigViewNames, 0, 1), 1)



"ExcelMonkey" wrote:

Can someone please remind me how to use match on a 2d array ("OrigViewNames")
if i am looking to return the position of a value (x) in the second column of
the array.

This does not work:
Application.Match(x, OrigViewNames, 0)

What do I have to put after the OrigViewNames to indicate column 2.

Thanks

EM

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
MATCH() on a 2D array? Geoff Lambert Excel Discussion (Misc queries) 7 April 25th 23 03:48 AM
Match using array of column and row references to match with jkfin1 Excel Worksheet Functions 1 September 16th 08 04:39 PM
Match & array Carmen Excel Worksheet Functions 2 July 31st 07 04:08 AM
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
Match as well as does not match array function Vikram Dhemare Excel Discussion (Misc queries) 7 April 25th 06 09:15 AM


All times are GMT +1. The time now is 10:37 PM.

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

About Us

"It's about Microsoft Excel"