Code:
Sub BalanceInfo()
'gets the last row with data
LastRow = Sheet2.Cells(Rows.Count, "C").End(xlUp).Row
MsgBox "The lowest balance was " & Format(WorksheetFunction.Min(Sheet2.Range("H4:H" & LastRow & "")), "#,##0.00") & _
vbNewLine & vbNewLine & _
"The highest balance was " & Format(WorksheetFunction.Max(Sheet2.Range("H4:H" & LastRow & "")), "#,##0.00") _
, , "Balance Information"
End Sub
I am using the code above to get the lowest and highest amounts in column H, this is working fine, I would also like to get the date in column C that corresponds to the min and max in column H. so if the min in column H was in row 24 I want the date that is in C24 something like below. Thanks using excel 2003
Code:
Sub BalanceInfo()
'gets the last row with data
LastRow = Sheet2.Cells(Rows.Count, "C").End(xlUp).Row
MsgBox "The lowest balance was " & Format(WorksheetFunction.Min(Sheet2.Range("H4:H" & LastRow & "")), "#,##0.00") & " on what every date it was" & _
vbNewLine & vbNewLine & _
"The highest balance was " & Format(WorksheetFunction.Max(Sheet2.Range("H4:H" & LastRow & "")), "#,##0.00") & " on what every date it was" _
, , "Balance Information"
End Sub