It's a little dirty, but seeing you in Excel ...
' Create a sheet with codename wsTemp... For i = 0 To UBound(fltArr) wsTemp.cells(i,1) = i wsTemp.cells(i,2) = fltArr(i) Next with wsTemp .range(.cells(1,1),.cells(i,2)).sort(wsTemp.cells(1,2),xlDescending) end with Result = wsTemp.cells(n,1)
Then you can also expand the sort to "sort by value, then by index" if you want to control "out of two equal 2 I have to choose" thing ...
source share