发布网友 发布时间:2022-09-20 16:07
共4个回答
热心网友 时间:2023-11-05 18:10
If InStr(Range("B" & CStr(i)).Text, "双") > 0 or InStr(Range("B" & CStr(i)).Text, "男") > 0 or InStr(Range("B" & CStr(i)).Text, "背") > 0 then热心网友 时间:2023-11-05 18:11
放到A1热心网友 时间:2023-11-05 18:11
需要更高效的代码就追问我。你现在这个效率肯定低。追问请说追答Sub AAA()
Dim Ar
Dim I As Long
Dim J As Long
Dim Rng As Range
Dim Flag As Boolean
Br = Array("关键字1", "关键字2", "关键字3", "关键字4")
Ar = Range([B1], [B65536].End(xlUp))
For I = 1 To UBound(Ar)
For J = 0 To UBound(Br)
If InStr(Ar(I, 1), Br(J)) > 0 Then
If Rng Is Nothing Then
Set Rng = Rows(I)
Else
Set Rng = Union(Rng, Rows(I))
End If
Exit For
End If
Next
Next
If Not Rng Is Nothing Then Rng.delete
End Sub
有多少个关键字就照着加上去就好了。
热心网友 时间:2023-11-05 18:12
用 “OR”就行了