只改了内层条件,外面的没管
If Target.Value <> "" Then
Application.EnableEvents = 0
tmp = Target.Value
Target = ""
If Range("A:A").Find(tmp, , , , , , 1) Is Nothing Then
Target = tmp
Else
MsgBox "请不要重复录入"
Application.Undo
End If
Application.EnableEvents = 1
End If
只改了内层条件,外面的没管
If Target.Value <> "" Then
Application.EnableEvents = 0
tmp = Target.Value
Target = ""
If Range("A:A").Find(tmp, , , , , , 1) Is Nothing Then
Target = tmp
Else
MsgBox "请不要重复录入"
Application.Undo
End If
Application.EnableEvents = 1
End If