View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_3_] Alan Beban[_3_] is offline
external usenet poster
 
Posts: 130
Default Can you identify the maximum value in an array?

Application.Match(Application.Max(Arr),Arr) or

Application.Match(Application.Large(Arr,1),Arr)

Alan Beban

Brad Patterson wrote:
Dim Arr(5) as integer

Arr(2) = 99
Arr(3) = 101

How do I then find out what the maximum value is, and what position it?s
at in this type of array ? i.e. for the above, the maximum is 101, at
position 3.

I?ve had success with

Application.WorksheetFunction.Large(Arr, 1)

But still can?t get the position of that number.

I?m attempting this with an array that is 1000 in size if that?s going
to be a problem ...

Thanks,

Brad.)