|
Sub 添加()
Dim a(5) As String, i As Long, j As Long
a(1) = Sheets("sheet1").Cells(2, 2)
a(2) = Sheets("sheet1").Cells(2, 4)
a(3) = Sheets("sheet1").Cells(3, 2)
a(4) = Sheets("sheet1").Cells(3, 4)
a(5) = Sheets("sheet1").Cells(4, 2)
r = Sheets("sheet2").Range("b65535").End(xlUp).Row
If r > 2 Then
For i = 3 To r
If Sheets("sheet2").Cells(i, 2) = a(1) Then
y = MsgBox("姓名有重复数据,是否添加", 4)
If y = 6 Then GoTo 100
Exit Sub
End If
Next i
End If
100:
Sheets("sheet2").Cells(r + 1, 1) = r - 1
For j = 2 To 6
Sheets("sheet2").C
|
|