Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MATCH() on a 2D array? | Excel Discussion (Misc queries) | |||
Match using array of column and row references to match with | Excel Worksheet Functions | |||
Match & array | Excel Worksheet Functions | |||
index match array function-returning only first match, need last. | Excel Worksheet Functions | |||
Match as well as does not match array function | Excel Discussion (Misc queries) |