السلام عليكم
الاخت الفاضلة
سيكون الكود كالتالي
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column > 1 Then Exit Sub
Application.EnableEvents = False
Range("e3:e14") = ""
Range("e3:e14").Interior.ColorIndex = xlNone
Application.EnableEvents = True
n = 1
For i = 3 To 14
If Cells(i, 1).Interior.ColorIndex <> xlNone Then
Application.EnableEvents = False
Cells(i, 5) = n
Cells(i, 5).Interior.ColorIndex = 15
Application.EnableEvents = True
End If
Next
End Sub
تحياتي