Is there a way to change the below script so that it does not highlight values that are "0"?
Code
Sub Conditions()Dim myrange As Range
For i = 1 To 10000
Set myrange = Range("A" & i & ":" & "O" & i)
myrange.FormatConditions.AddTop10
myrange.FormatConditions(myrange.FormatConditions.Count).SetFirstPriority
With myrange.FormatConditions(1)
.TopBottom = xlTop10Top
.Rank = 3
.Percent = False
End With
With myrange.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
myrange.FormatConditions(1).StopIfTrue = False
myrange.FormatConditions.AddTop10
myrange.FormatConditions(myrange.FormatConditions.Count).SetFirstPriority
With myrange.FormatConditions(1)
.TopBottom = xlTop10Bottom
.Rank = 3
.Percent = False
End With
With myrange.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 15773696
.TintAndShade = 0
End With
myrange.FormatConditions(1).StopIfTrue = False
Next
End Sub
Display More