|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub TEST3()
Dim ar, br, i&, j&, r&, isFlag As Boolean, t#
Application.ScreenUpdating = False
t = Timer
br = [{1,"A1";4,"X002";10,"100";12,"4"}]
With Intersect(Columns("A:P"), ActiveSheet.UsedRange)
ar = .Value: r = 1
.Cells.ClearContents
For i = 2 To UBound(ar)
isFlag = False
For j = 1 To UBound(br)
If InStr(ar(i, br(j, 1)), br(j, 2)) Then
isFlag = True: Exit For
End If
Next j
If isFlag = False Then
r = r + 1
For j = 1 To UBound(ar, 2)
ar(r, j) = ar(i, j)
Next j
End If
Next i
End With
[A1].Resize(r, UBound(ar, 2)) = ar
Application.ScreenUpdating = True
MsgBox "执行完毕!_用时: " & Format(Timer - t, "0.00") & " 秒", 64
End Sub
|
|