|
Option Explicit
Sub TEST()
Dim regEx As Object, ar, i&, Rng As Range, strPat$
Set regEx = CreateObject("VBScript.RegExp")
ar = Sheets(2).[A1].CurrentRegion
For i = 2 To UBound(ar)
strPat = strPat & "|" & ar(i, 2)
Next
strPat = Mid(strPat, 2)
regEx.Pattern = strPat
With [A1].CurrentRegion
ar = .Value
For i = 2 To UBound(ar)
If regEx.TEST(ar(i, 3)) Then
If Rng Is Nothing Then
Set Rng = .Rows(i)
Else
Set Rng = Union(Rng, .Rows(i))
End If
End If
Next i
End With
If Not Rng Is Nothing Then Rng.Delete
Set regEx = Nothing: Set Rng = Nothing
Beep
End Sub
|
评分
-
1
查看全部评分
-
|