MAX & MIN - Can Column Header be returned with these?
This UDF is for Max:
Public Function header(r As Range) As String
Dim rr As Range
Dim v As Variant
v = Application.WorksheetFunction.Max(r)
For Each rr In r
If rr.Value = v Then
Exit For
End If
Next
header = Cells(1, rr.Column).Value
End Function
Min is similar
--
Gary''s Student - gsnu200800
"Diana" wrote:
Hello,
I'm doing MAX & MIN formulas on financial data. Instead of having the
actual MAX or MIN dollar amount show, I want the column header name to appear
instead. I haven't been able to figure it out. Is what I'm asking for
something that can be done?
Thanks for any guidance!
|