+ Reply to Thread
Results 1 to 7 of 7

Search Text determine which terms it contains

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Search Text determine which terms it contains

    I have a spreadsheet where I want to search text for multiple search terms, listed in a column on separate tab.

    For example, if my search terms were:

    Red Sox
    Yankees
    Blue Jays
    Orioles
    Rays

    and I was searching the following text:

    "The Red Sox defeated the Orioles yesterday and remain 3 games up on the Yankees"

    the macro should return:

    "Red Sox, Orioles, Yankees"

    See the attached spreadsheet for a fuller example.
    Attached Files Attached Files
    Last edited by LarryLegend; 11-20-2013 at 03:00 PM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search Text determine which terms it contains

    Maybe:

    Please Login or Register  to view this content.
    Output sent to Text Column C
    Last edited by JOHN H. DAVIS; 11-20-2013 at 02:59 PM.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search Text determine which terms it contains

    This is in response to your PM. See if it helps.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-06-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Search Text determine which terms it contains

    Hi John,

    Thank you for the reply. It looks like this version will return the search term only if the search term is found exactly AND if it is the only contents of the cell. I need it be exact, but it doesn't need to be the only contents of the cell.

    I'm trying to get it so it will return the search term if the term is found anywhere within the cell, but it must be found by itself.

    For example, if the term "ING" was on my list:

    Search Cell = "IBM is releasing quarterly earnings tomorrow" ; Return should be blank. The original version would pick up the 'ING' from the word 'releasING'
    Search Cell = "ING released quarter earnings this morning" ; Return should be 'ING'

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search Text determine which terms it contains

    Try:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 11-25-2013 at 01:38 PM.

  6. #6
    Registered User
    Join Date
    12-06-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Search Text determine which terms it contains

    John,

    This works great. Last question, is there a way to adjust it so that it ignores capitalization rules?

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search Text determine which terms it contains

    Add this line at the Top of your Module

    Option Compare Text
    Last edited by JOHN H. DAVIS; 11-27-2013 at 12:18 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro/s to create Search Bar to filter to search terms entered activated by Command Button
    By JasonRay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2013, 03:44 PM
  2. Truncate text strings using LEFT and FIND/SEARCH for multiple search terms
    By ngdoherty in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2013, 07:51 PM
  3. [SOLVED] Match search terms, and add data in next column. Multi search problem.
    By Wales MB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-23-2013, 06:10 PM
  4. Determine the hierarchy of excel formula terms with VBA
    By Craigjre in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-07-2012, 08:41 AM
  5. Two search category & two search terms
    By avk in forum Excel General
    Replies: 3
    Last Post: 05-17-2010, 02:32 PM

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