Question : How to Highlight cells with 10 TEN VALUES (XLS)
Answered by : shane-eckel
Sub TopTen() Selection.FormatConditions.AddTop10 Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority With Selection.FormatConditions(1) .TopBottom = xlTop10Top 'Change the rank here to highlight a different number of values .Rank = 10 .Percent = False End With With Selection.FormatConditions(1).Font .Color = -16752384 .TintAndShade = 0 End With With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 13561798 .TintAndShade = 0 End With Selection.FormatConditions(1).StopIfTrue = False
End Sub
Source : https://yonkov.github.io/post/18-ready-to-use-vba-codes-that-will-save-your-day/#9-highlight-top-ten-values | Last Update : Wed, 12 Oct 22