|
再改一下。- Sub ykcbf() '//2024.8.8
- Dim arr, brr
- Application.ScreenUpdating = False
- arr = Sheets("数据源").UsedRange
- ReDim brr(1 To UBound(arr), 1 To 2)
- r = Cells(Rows.Count, 3).End(3).Row
- zrr = Cells(4, 3).Resize(r - 3, 1)
- For x = 1 To UBound(zrr)
- For i = 2 To UBound(arr)
- If zrr(x, 1) = arr(i, 1) Then
- m = m + 1
- brr(m, 1) = arr(i, 1)
- brr(m, 2) = arr(i, 2)
- End If
- Next
- Next
- With Sheets("结果")
- .[a4:b10000] = ""
- .Range("a4").Resize(m, 2) = brr
- End With
- Set d = Nothing
- Application.ScreenUpdating = True
- MsgBox "OK!"
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|