من أعمال الأستاذ خبور
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim CC As Integer, C As Integer
Dim sR As String
Dim MyRng As Range
Set MyRng = Range("n8:Aw78")
If Not Intersect(Target, MyRng.Cells) Is Nothing Then
Application.EnableEvents = False
CC = MyRng.Column - 1
C = Target.Column - CC
sR = MyRng.Columns(C).Address
If Application.CountIf(Range(sR), Target.Value) > 1 Then
If MsgBox(" this value was enter" & vbLf & vbLf & "Do you want to continue? ", 16 + vbYesNo + 524288 + 1048576, "Note") = vbNo Then
Target.ClearContents
End If
End If
Kh_ColorIndex Range(sR)
Application.EnableEvents = True
End If
On Error GoTo 0
End Sub