السلام عليكم
استخدم الكود التالى
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
For i = 1 To 2
If Range("b" & i).font.Bold And Range("b" & i).font.ColorIndex = 3 Then
Range("a" & i) = 1
Else
Range("a" & i) = 2
End If
Next
Application.EnableEvents = True
End Sub
Book189.rar