Hiya Board
vba newbie again!
In Column A I have a random range of numerical data (5000 - 7000 entries)
I have the following code to highlight the row location of the max value.
--------------
Sub FindMax()
MaxVal = Application.WorksheetFunction. _
Max(Range("A:A"))
For Row = 1 To 65536
If Range("A1").Offset(Row - 1, 0).Value = MaxVal Then
Range("A1").Offset(Row - 1, 0).Activate
MsgBox "The max value can be found in row " & Row
Exit For
End If
Next Row
End Sub
------------
Occasionally up to 5 rows may contain the max figure,
How do I highlight all those row locations?
Once again, Any help would be greatly appreciated
Kind Regards
Ben.
vba newbie again!
In Column A I have a random range of numerical data (5000 - 7000 entries)
I have the following code to highlight the row location of the max value.
--------------
Sub FindMax()
MaxVal = Application.WorksheetFunction. _
Max(Range("A:A"))
For Row = 1 To 65536
If Range("A1").Offset(Row - 1, 0).Value = MaxVal Then
Range("A1").Offset(Row - 1, 0).Activate
MsgBox "The max value can be found in row " & Row
Exit For
End If
Next Row
End Sub
------------
Occasionally up to 5 rows may contain the max figure,
How do I highlight all those row locations?
Once again, Any help would be greatly appreciated
Kind Regards
Ben.