Top Object Example

Sub CreateTopPercentCondition() Dim oFormatCondition As Top10

'Add a new Formatting rule

Set oFormatCondition = Range("F5:F22").

.FormatConditions

.AddTop10

'Highlight all values that make up the Top

20% of the total

range

With oFormatCondition

.TopBottom = xlToplOTop

.Rank = 20

.Percent = True

.Font.Bold = True

.Interior.Color = 7039480

End With

End Sub

0 0

Post a comment