|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Option Explicit
Sub TEST3()
Dim ar, i&, j&, r&, t#, strJoin$
Application.ScreenUpdating = False
t = Timer
ar = Sheets(2).[A1].CurrentRegion.Value
For i = 2 To UBound(ar)
strJoin = strJoin & "," & ar(i, 2)
Next i
strJoin = strJoin & ","
ar = Sheets(1).[A1].CurrentRegion.Value
r = 1
For i = 2 To UBound(ar)
If InStr(strJoin, "," & ar(i, 6) & ",") Then
r = r + 1
For j = 1 To UBound(ar, 2)
ar(r, j) = ar(i, j)
Next j
End If
Next i
Cells.Clear
[A1].Resize(r, UBound(ar, 2)) = ar
Application.ScreenUpdating = True
MsgBox "执行完毕!_用时: " & Format(Timer - t, "0.00") & " 秒", 64
End Sub
|
评分
-
1
查看全部评分
-
|