Link to home
Start Free TrialLog in
Avatar of capterdi
capterdi

asked on

Similar case as Q27956847.

Hi EE,

I´m looking for a solution very much the same as the case described in Q27956847. Only difference is that in this case I would like the UDF to get the row number where the maximum value(s) is(are) found. Range of data is on column G. Please refer to sample file Book1.xls attached.

Thanks.
Book1.xls
Avatar of ButlerTechnology
ButlerTechnology

Try the below UDF:
Public Function MaxRow(rRange As Range) As Integer
Dim cCell As Variant
Dim Highestvalue As Single
Dim iRow As Integer
    For Each cCell In rRange
    If cCell.Value > Highestvalue Then
        Highestvalue = cCell.Value
        iRow = cCell.Row
        MsgBox Highestvalue
    End If
    Next
MaxRow = iRow
End Function

Open in new window

Avatar of capterdi

ASKER

It works, but before getting to the result, windows with numbers and an OK button keep popping up until you are done with the last one.
ASKER CERTIFIED SOLUTION
Avatar of ButlerTechnology
ButlerTechnology

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That´s it. Perfect.

Thanks.