PDA

View Full Version : Find Contents of cell



Tenspeed39355
01-20-2012, 06:10 AM
I have a spread sheet using the MAX command to find the max number in column
F. When it finds the number how do I find the contents of the matching cell in
column A. I am thinking I need to use the IF statement but from there I am stuck. Thanks for any help with this.
Max

mancubus
01-20-2012, 06:35 AM
Option Explicit
Sub FindMaxCell()

Dim maxRng As Range, maxCell As Range
Dim iMax As Variant, thisValue As Variant

Set maxRng = Columns(6)

iMax = Application.Max(maxRng)

Set maxCell = maxRng.Find(What:=iMax)

thisValue = maxCell.Offset(0, -5).Value

MsgBox thisValue

End Sub

mdmackillop
01-20-2012, 07:26 AM
=INDEX(A:A,MATCH(MAX(F:F),F:F,0))

Tenspeed39355
01-22-2012, 07:28 AM
Thanks for the help.
Max