Solved

Similar case as Q27956847.

Posted on 2014-01-05
4
256 Views
Last Modified: 2014-01-05
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
0
Comment
Question by:capterdi
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:ButlerTechnology
ID: 39757608
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

0
 

Author Comment

by:capterdi
ID: 39757629
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.
0
 
LVL 6

Accepted Solution

by:
ButlerTechnology earned 300 total points
ID: 39757642
Sorry -- Remove the msgbox HighestValue line -- I was using that for testing.
0
 

Author Closing Comment

by:capterdi
ID: 39757648
That´s it. Perfect.

Thanks.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now