Thread: [Solved] AND/OR/NOT-search
View Single Post
 
Old 09-08-2011, 07:03 AM
Catalin.B Catalin.B is offline Windows Vista Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

There is a good macro you can use, made by hiker95: (same macro in sample attached) You can enter in sheet Keywords how many keywords you need , the limit is the number of excel rows...
Code:
Option Explicit
Option Base 1
Sub CKKeywords()
Dim c As Range, a As Long, b As Long
Dim MyKeys As Variant
Application.ScreenUpdating = False
MyKeys = Sheets("Keywords").Range("A2:A" & Sheets("Keywords").Cells(Rows.Count, 1).End(xlUp).Row)
With Sheets("Sheet1")
  For Each c In .Range("C1", .Range("C" & Rows.Count).End(xlUp))
    For a = LBound(MyKeys) To UBound(MyKeys)
      b = 0
      On Error Resume Next
      b = WorksheetFunction.Find(Trim(MyKeys(a, 1)), c, 1)
      On Error GoTo 0
      If b > 0 Then
        c.Offset(, 1) = "Yes"
        Exit For
      End If
    Next a
  Next c
End With
Application.ScreenUpdating = True
End Sub
Attached Files
File Type: xlsm search after multiple keywords.xlsm (16.4 KB, 11 views)
Reply With Quote