Solved

Similar case as Q27956847.

Posted on 2014-01-05
4
260 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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…

896 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

15 Experts available now in Live!

Get 1:1 Help Now