السلام عليكم
اخي abusarah73
مشكور اخي علي كلماتك
اخي aitlahbib
شوف الملف المرفق و اخبرني النتيجه
والكود المستخدم هو
Private Sub Worksheet_Selectionchange(ByVal Target As Range)
If Target.Column > 31 Then Exit Sub
Application.ScreenUpdating = False
x = Target.Column
If Cells(1, x).Value = "*" Then
GoTo 1
Else
GoTo 2
End If
1:
m = Cells(2, x).Address
n = Cells(50, x).Address
Application.ScreenUpdating = False
Range(m, n).Interior.ColorIndex = 4
Application.ScreenUpdating = True
Exit Sub
2:
m = Cells(2, x).Address
n = Cells(50, x).Address
Application.ScreenUpdating = False
Range(m, n).Interior.ColorIndex = xlNone
Application.ScreenUpdating = True
End Sub
تحياتي
column color.rar