Sub FindMinMax()
FinalRow = cells(Application.Rows.count, 1).End(xlUp).row
With range("A2:I" & FinalRow)
.FormatConditions.delete
.FormatConditions.add Type:=xlExpression, Formula1:="=RC7=MAX(C7)"
.FormatConditions(1).Interior.ColorIndex = 4
.FormatConditions.add Type:=xlExpression, Formula1:="=RC7=MIN(C7)"
.FormatConditions(2).Interior.ColorIndex = 6
End With
End Sub
|