+ Reply to Thread
Results 1 to 6 of 6

Look for a word with a range and only display a row where the word is listed

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Look for a word with a range and only display a row where the word is listed

    Basically I have a bunch of survey data that goes from range A1:H35752, and the cells in F6:H35752 contain text data (sentences, phrases, single words). What I need to be able to do is in cell "E2" I would like to be able to type a word such as "Apples" and any row that contains at least one instance of the word "Apple or Apples" in columns F:H would remain visible while every other row would be hidden. I have included an example that I hope will clarify what I need. Thank you all for your help!

    -Update: If its not possible to to combine a plural word with a singular word then I can live with that.
    Attached Files Attached Files
    Last edited by bbarth; 04-14-2015 at 05:11 PM. Reason: Update

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Look for a word with a range and only display a row where the word is listed

    1) In K2 put the word "KEY"

    2) In K3 put this helper formula, then copy down as far as needed:
    =ISNUMBER(MATCH("*" & $E$2 & "*", F6:H6, 0))

    3) Right-click on the tab name and select VIEW CODE to open the VBA editor

    4) Paste in this event macro to the sheet module that appears:
    Please Login or Register  to view this content.
    Read through the code until it starts to become obvious what each line of code is doing. We are essentially applying a new Autofilter to column K anytime cell E2 is edited, the Autofilter is showing all the rows that currently show "TRUE" in that column, meaning the key word was found on that row.

    Now that the macro is installed and functioning, you could hide column K if you wish to make what is happening look like magic.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Look for a word with a range and only display a row where the word is listed

    JBeaucaire, the thing I'm wondering about is pineapples. I couldn't figure out a way to exclude it. In the original post on the after sheet it was not included so I assumed the OP wanted to exclude it.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Look for a word with a range and only display a row where the word is listed

    When faced with partial string matches, there's little chance, IMO, that Excel can be expected to know which substrings to match and which to ignore. So Apple would absolutely match to:

    Apple
    Apples
    Crabapples
    Pineapples
    Grapple

    Substring match is a substring match.

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,518

    Re: Look for a word with a range and only display a row where the word is listed

    This should do
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-14-2014
    Location
    Farmington, Utah
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Look for a word with a range and only display a row where the word is listed

    Thank you everyone for the help. I tried JBeaucaire's suggestion first and it worked like a charm! I really appreciate the help everyone gave you are truly amazing people. Thank you again.

+ 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] (Challenge) Sum Order From Count "Center" Word To Start Word & "Center" Word To End Word
    By sanju2323 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-31-2015, 12:58 AM
  2. Replies: 0
    Last Post: 06-10-2014, 06:31 PM
  3. Copy Many Word Docs to New Word Doc (Each Word Doc Should be on New Page)
    By realniceguy5000 in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 05-05-2013, 03:28 AM
  4. Replies: 13
    Last Post: 08-04-2011, 09:41 AM
  5. Possible to display the 1st 5 letters of a word??
    By jasonmcbride in forum Excel General
    Replies: 7
    Last Post: 11-13-2008, 06:30 PM

Tags for this Thread

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