|
Sub 登记()
Application.ScreenUpdating = False
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
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
x = Application.Index(brr, j)
rng1.Range("a" & M).Resize(1, 15) = x
n = n + 1
rng1.Range("a" & M) = n
End If
Next j, i
Application.ScreenUpdating = True
End Sub
这个运行快些
|
|