Private Sub Worksheet_Change(ByVal Target As Range)
'مع أطيب تحية من أبي أحمد
'غير الرقم 1 برقم العمود الذي تستخدم
If Target.Column <> 1 Or Target.Row = 1 Then Exit Sub
Co = Target.Column
If Target.Value <= 50 Or Target.Value = "غائب" Then
Cells(Target.Row, Co).Select
Selection.Interior.ColorIndex = xlNone
Else
Target.Value = ""
MsgBox "اكتب هنا رقما بين 1 إلى 50 أو غائب", , "عفوا"
Cells(Target.Row, Co).Select
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
Exit Sub
End If
End Sub