|
Sub 记录()
Application.ScreenUpdating = False
Dim ar As Variant, cr As Variant
Dim i As Long, r As Long, rs As Long
Dim br(), brr()
Dim d As Object
Set d = CreateObject("scripting.dictionary")
With Sheets("下单表")
kh = .[b3]
qy = .[g3]
If kh = "" Then MsgBox "请输入客户信息": End
If qy = "" Then MsgBox "请输入区域信息": End
End With
zf = kh & "|" & qy
With Sheets("客户区域")
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r > 1 Then
ar = .Range("a1:b" & r)
For i = 2 To UBound(ar)
zd = ar(i, 1) & "|" & ar(i, 2)
d(zd) = ""
Next i
End If
If Not d.exists(zf) Then
.Cells(r + 1, 1) = kh
.Cells(r + 1, 2) = qy
MsgBox "录入完毕!"
Else
MsgBox "已存在,无需录入!"
End If
End With
End Sub
|
|