Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I return location (not value)of an Excel array's max value
How do I return the cell location (in addition to the value contained in the
cell) of the maximum value in an Excel array? I'm trying to locate the row number for the maximum value in a column of numbers. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I return location (not value)of an Excel array's max value
Here is a function that returns a cell (range object) of the highes value in
a speicfied range. Public Function MaxValue(ByVal rngToSearch As Range) As Range Set MaxValue = rngToSearch.Find(Application.Max(rngToSearch)) End Function Sub test() Dim rng As Range Set rng = MaxValue(ActiveSheet.Range("B:B")) MsgBox rng.Value & vbTab & rng.Address End Sub -- HTH... Jim Thomlinson "Doug" wrote: How do I return the cell location (in addition to the value contained in the cell) of the maximum value in an Excel array? I'm trying to locate the row number for the maximum value in a column of numbers. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I return location (not value)of an Excel array's max value
Doug wrote:
How do I return the cell location (in addition to the value contained in the cell) of the maximum value in an Excel array? I'm trying to locate the row number for the maximum value in a column of numbers. The following will return the location of the max within the column. If it returns "1" it's the first element of the array, and so forth. [ ] = MATCH(MAX(A1:A10),A1:A10) Bill |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I return the location (as a range) of ActiveCell? | Excel Discussion (Misc queries) | |||
How do I return the cell location | Excel Discussion (Misc queries) | |||
Return the Row of a Variable's location | Excel Discussion (Misc queries) | |||
Help with array's | Excel Worksheet Functions | |||
Selecting & Displaying An Array's Contents | Excel Programming |