Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
my task is as follows: Look for the maximum of the average grades and display it in a message box by the MsgBox function. Now that I found the max. value with Set myRange = Range("E2", ActiveCell) max = Application.WorksheetFunction.max(myRange) how do I get the respective row number? Any help will be appreciated. Thanks in advance --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like the following:
Dim DataRng As Range Dim MaxVal As Variant Dim MaxRow As Long Set DataRng = Range("A2:A10") With Application.WorksheetFunction MaxVal = .Max(DataRng) MaxRow = DataRng.Row + .Match(MaxVal, DataRng, 0) - 1 MsgBox MaxRow End With -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "CGeorges " wrote in message ... Hello, my task is as follows: Look for the maximum of the average grades and display it in a message box by the MsgBox function. Now that I found the max. value with Set myRange = Range("E2", ActiveCell) max = Application.WorksheetFunction.max(myRange) how do I get the respective row number? Any help will be appreciated. Thanks in advance --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find maximum row count of data | Excel Discussion (Misc queries) | |||
function to find the row number of the maximum value in a coll | Excel Worksheet Functions | |||
Find Maximum date | Excel Worksheet Functions | |||
find maximum | Excel Discussion (Misc queries) | |||
find which column has the maximum value | Excel Discussion (Misc queries) |