View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Index of Minimum value in array

Hi Paul,

If you already have the data in a VBA array I think the fastest solution
would be a single pass loop: any other solution is going to have to read
each element at least once anyway.
I suspect that the additional overhead of using a worksheet function will
outweigh any speed gain you might get.

Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com

"Paul Stevens" wrote in message
...
In a two dimensional array I want to find the position of
the minimum value in the first dimension and return the
value from the equivalent position in the second dimension.

My array is a VBA variable, not a range reference, and
it's values are not in any order. Ubound is several
thousand so I don't want to loop and for other reasons do
not want to sort. If necessary my two dim array could be
reconstructed as two complimentary single dim arrays.

I've been messing around with various worksheet functions
(incl .Min), but I'm fumbling!

TIA for any help,
Paul