Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Similar case as Q27956847.

Posted on 2014-01-05
Medium Priority
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.

Question by:capterdi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

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
MaxRow = iRow
End Function

Open in new window


Author Comment

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.

Accepted Solution

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

Author Closing Comment

ID: 39757648
That´s it. Perfect.


Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
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…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

618 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