بعد إذن أخي الفاضل ياسر أبو خليل
هذا كود يقوم بتلوين الخليه الفعاله إلي اللون الأصفر
ملحوظة :- قم بوضعه في الشيت الذي تريد تفعيل الخليه إلي اللون الأصفر
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MyColor = 6
If Not IsError(Me.[N_Color_Rng]) Then
If Not IsError(Me.[N_Color_Color]) Then
If Not IsError(Me.[N_Color_Old]) Then
If Me.[N_Color_Rng].Interior.ColorIndex = Me.[N_Color_Old] Then
Me.[N_Color_Rng].Interior.ColorIndex = Me.[N_Color_Color]
End If
End If
End If
End If
Me.Names.Add "N_Color_Rng", ActiveCell
Me.Names.Add "N_Color_Color", ActiveCell.Interior.ColorIndex
Me.Names.Add "N_Color_Old", MyColor
ActiveCell.Interior.ColorIndex = MyColor
End Sub