Solved

Similar case as Q27956847.

Posted on 2014-01-05
4
270 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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use System DSN 6 91
PowerView Button Missing From Excel 2013 Pro Plus Insert Tab 7 2,564
encryption on machine 7 90
converting visio 2010 to powerpoint 2010  - formatting issues 5 109
User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

696 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