|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Sub 登记()
Dim arr, brr
Dim rng As Worksheet
Dim rng1 As Worksheet
Set rng = Sheets(2)
Set rng1 = Sheets(4)
Dim i As Integer, j As Integer, M As Integer, n
arr = Sheets(1).Range("a1").CurrentRegion
brr = rng.Range("a1").CurrentRegion
Application.ScreenUpdating = False
For i = 1 To UBound(arr)
For j = 1 To UBound(brr)
M = Sheets(4).Range("a1045876").End(xlUp).Row + 1
If arr(i, 3) & arr(i, 4) & arr(i, 5) & arr(i, 6) = brr(j, 5) & brr(j, 6) & brr(j, 7) & brr(j, 9) Then
n = n + 1
rng1.Range("a" & M) = n
rng.Range("b" & j).Resize(1, 14).Copy rng1.Range("b" & M)
End If
Next j, i
Application.ScreenUpdating = True
End Sub
|
|