在Excel中查找多个文本

我在Excel中有大量的数据,我想摆脱包含我的“标签”的行。 查找选项允许我只有一个单词/search,我有数百个单词。 它可能是一个macros观或论点。 我试了下面的论点,但是只find了1。

=IF(OR(ISNUMBER(SEARCH({"word1","word2","word3"},A1,B1)))"YES","NO") 

有人帮助我

之前

在这里输入图像说明

macros运行

 Option Explicit Sub RemoveRowsBasedOnArrayCondition() Dim searchTerms As Variant searchTerms = Array("tag1", "tag2", "tag3") ReDim rowsToDelete(0) As String Dim allRange As Range Set allRange = ActiveSheet.UsedRange Dim cell As Range, word As Variant For Each cell In allRange For Each word In searchTerms If InStr(1, cell, word, vbTextCompare) Then rowsToDelete(UBound(rowsToDelete)) = CStr(cell.Row) ReDim Preserve rowsToDelete(UBound(rowsToDelete) + 1) End If Next word Next cell ReDim Preserve rowsToDelete(UBound(rowsToDelete) - 1) RemoveDuplicate rowsToDelete Dim v As Long For v = UBound(rowsToDelete) To LBound(rowsToDelete) Step -1 Rows(rowsToDelete(v)).Delete Next End Sub Sub RemoveDuplicate(ByRef StringArray() As String) Dim lowBound$, UpBound&, A&, B&, cur&, tempArray() As String If (Not StringArray) = True Then Exit Sub lowBound = LBound(StringArray): UpBound = UBound(StringArray) ReDim tempArray(lowBound To UpBound) cur = lowBound: tempArray(cur) = StringArray(lowBound) For A = lowBound + 1 To UpBound For B = lowBound To cur If LenB(tempArray(B)) = LenB(StringArray(A)) Then If InStrB(1, StringArray(A), tempArray(B), vbBinaryCompare) = 1 Then Exit For End If Next B If B > cur Then cur = B: tempArray(cur) = StringArray(A) Next A ReDim Preserve tempArray(lowBound To cur): StringArray = tempArray End Sub 

之后

在这里输入图像说明