Private Sub Worksheet_Change(ByVal Target As Range)
Set cl = Sheets("开票信息").Range("a" & Rows.Count).End(3)
If Target = cl Then
For i = 2 To cl.Row-1
If Target.Value = Cells(i, 1) Then
s = i
Exit For
End If
Next
If s <> 0 Then
MsgBox "客户信息已存在,请核实后输入,位于第" & s & "行"
cl.ClearContents
Range("a" & s).Select
End If
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Set cl = Sheets("开票信息").Range("a" & Rows.Count).End(3)
If Target = cl Then
For i = 2 To cl.Row-1
If Target.Value = Cells(i, 1) Then
s = i
Exit For
End If
Next
If s <> 0 Then
MsgBox "客户信息已存在,请核实后输入,位于第" & s & "行"
cl.ClearContents
Range("a" & s).Select
End If
End If
End Sub