مرفق كود لتلوين الخلية النشطة او الصف النشط
Private objCurrentCell As Range
Private OrigColorIdx As Long
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo SelectionChange_Err
Application.EnableEvents = False
If objCurrentCell Is Nothing Then
Set objCurrentCell = Target
OrigColorIdx = Target.Interior.ColorIndex
If OrigColorIdx < 0 Then OrigColorIdx = 0
Target.Interior.ColorIndex = 25
Else
objCurrentCell.Interior.ColorIndex = OrigColorIdx
Set objCurrentCell = Target
OrigColorIdx = Target.Interior.ColorIndex
If OrigColorIdx < 0 Then OrigColorIdx = 0
Target.Interior.ColorIndex = 25
End If
Application.EnableEvents = True
Exit Sub
SelectionChange_Err:
Application.EnableEvents = True
End Sub