السلام عليكم
الاخ samnajo
هذه طريقه اخرى (سالت عن طرق اخرى)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MMax As Variant
Dim MMin As Variant
Dim MyRng As Range
'------------------------------------------
Set MyRng = ActiveSheet.Range("A1:A20")
'------------------------------------------
MyRng.FormatConditions.Delete
'------------------------------------------
MMax = Application.WorksheetFunction.Max(MyRng)
MyRng.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:=MMax
MyRng.FormatConditions(1).Font.ColorIndex = 3
'------------------------------------------
MMin = Application.WorksheetFunction.Min(MyRng)
MyRng.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, Formula1:=MMin
MyRng.FormatConditions(2).Font.ColorIndex = 5
End Sub
FormatConditions.rar