+ Reply to Thread
Results 1 to 6 of 6

Setting up a search macro to find multiple words

Hybrid View

O0J0E Setting up a search macro to... 03-16-2012, 08:42 AM
mrice Re: Setting up a search macro... 03-16-2012, 09:35 AM
O0J0E Re: Setting up a search macro... 03-16-2012, 12:25 PM
O0J0E Re: Setting up a search macro... 03-16-2012, 02:08 PM
O0J0E Re: Setting up a search macro... 03-16-2012, 03:22 PM
Tinapie Re: Setting up a search macro... 09-19-2013, 05:14 AM
  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    12

    Re: Setting up a search macro to find multiple words

    I had to modify this a bit but this was more what I was after, thanks for the reply here is the code I used:

    Sub Search2()
    Dim MyArray() As String
    Dim N As Long
    Dim SearchRange As Range
    Dim FoundCell As Range
    
    Range("H11").CurrentRegion.ClearContents: Range("H11") = "Results"
    
    MyArray = Split(Range("H5"), " ")
    For Each Cell In Range("A2", Range("A" & Rows.Count).End(xlUp))
    For N = 0 To UBound(MyArray)
    If InStr(Cell, MyArray(N)) <> 0 Then
    Cell.Offset(, 0).Resize(, 7).Copy Range("H" & Rows.Count).End(xlUp).Offset(1, 0)
    End If
    Next N
    Next Cell
    
    
    End Sub
    Thanks again!

  2. #2
    Registered User
    Join Date
    03-08-2012
    Location
    New Hampshire
    MS-Off Ver
    2010
    Posts
    12

    Re: Setting up a search macro to find multiple words

    only thing I forgot was to set something for Both uppercase and lower case, working on it now.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1