View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Match function not wokring on 2D array

Just run a loop either lbound to ubound or vice-versa, depending on
what you expect to get your answer the quickest. Once you got the answer
you can do an Exit For.

RBS


"ExcelMonkey" wrote in message
...
What I am trying to do is redim and array. I have a 2D array with values
in
the second column. They array is sorted in descending order. I want to
redim the array so to get rid of all rows with 0 values in the first
column.
I was using the match to find the row with the first 0 and use this to
redim
the array.

Thanks

EM

"RB Smissaert" wrote:

I don't think it works on 2-D arrays as how would it know what column to
look in? There is no column argument in the function.
As your array is sorted you could do a binary search or use VLookup.

RBS

"ExcelMonkey" wrote in message
...
What is wrong here? I have a 2D array. The following gives me an
error
say
it can't find Match property. I am trying to locate first row with 0
in a
sorted array (high to low)

MaxRow = Application.WorksheetFunction.Match(0, ConsFunctionArray, 1)

Yet I know that my first zero value occurs in row 5 of the second
dimension
in hte 0-based array

?ConsFunctionArray(4,1)
0

As such I am expectinge th results to give me a 4 above.