أتمنى أن أكون قد توصلت إلى ما تريد،
Private Sub Worksheet_Change(ByVal Target As Range)
TC = Target.Column
TR = Target.Row
If TC > 1 And TC < 7 And TR < 5 Then
If Target > Cells(TR, 1) Then
Target.Interior.ColorIndex = xlNone
Target.Font.ColorIndex = 10
ElseIf Target < Cells(TR, 1) Then
Target.Interior.ColorIndex = 34
Target.Font.ColorIndex = 3
ElseIf Target > Cells(TR, TC - 1) Then
Target.Interior.ColorIndex = 19
Target.Font.ColorIndex = 10
ElseIf Target < Cells(TR, TC - 1) Then
Target.Interior.ColorIndex = xlNone
Target.Font.ColorIndex = 3
End If
End If
End Sub
شاهد المرفق،
Conditional_Formatting.rar