+ Reply to Thread
Results 1 to 9 of 9

Highlighting all cells in sheet that contain String

  1. #1
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Highlighting all cells in sheet that contain String

    What if you just want to search for a string, like how you would use Ctrl-F in Word? I want to be able to search a list of names and type something like "Johns" and have Excel highlight all cells containing "Johnson", "Johnstone", etc to make finding someone's name easier.

    Thanks in advance!
    Last edited by CriticalMass048; 01-21-2021 at 01:51 PM. Reason: To comply

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Just a simple search!

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Just a simple search!

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Re: Just a simple search!

    Logit, thank you for the advice and programming, but that wasn't exactly what I wanted.

    I'm looking for only a partial string in the list, so if I'm searching for someone's name quickly in a list that is not alphabetical, I can find it. For instance, if I'm looking for "Boris Johnson" in a list of names, I could type only "Boris" or "Johns" and any cell containing those values would "light up" so that a user could find it quicker.

    I just thought there would be a "Hotkey" command, like Ctrl-F. For some reason, when I use Ctrl-F in Excel, even if I type "Boris Johnson", I get told Excel couldn't find what I was looking for. Maybe I'm doing something wrong.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Just a simple search!

    You could set up conditional formatting to highlight a range of cells (individually) if there is a partial match with that string. Suppose you use M1 to enter "Boris" (without the quotes), then your CF formula would be:

    =ISNUMBER(FIND($X$1,A2))

    assuming A2 is the starting cell where you want to search for the name. You can use the Applies To option to define the range.

    Hope this helps.

    Pete

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Highlighting all cells in sheet that contain String

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-12-2020
    Location
    Philadelphia, PA
    MS-Off Ver
    2016
    Posts
    97

    Re: Highlighting all cells in sheet that contain String

    Pete_UK: Thanks! Other than the fact that it's case-sensitive, and when the cell is blank, the entire column is highlighted, it works great! I can try to go in and change the CF to only format if the cell has a value in it, but I can live with it either way!

    Logit: Unfortunately, I just saw your second attempt. I will try that one as well! Thanks!

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Highlighting all cells in sheet that contain String

    Building on Pete's work in post 5.

    Try: =AND(A1<>"",SEARCH($X$1,A1))
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  9. #9
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Highlighting all cells in sheet that contain String

    Here is a non-looping macro that should be quite fast. It starts by asking you the text you want to search for and then "uncolors" any existing colored cells and then colors the cells that match your search criteria.
    Please Login or Register  to view this content.

+ 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. Simple search bar to search data in column
    By Richardph in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-29-2018, 06:32 AM
  2. Simple search box column and retrive results to search box sheet
    By Tanakaka in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 01-08-2017, 08:47 AM
  3. [SOLVED] Search & Replace....should be simple
    By JimDandy in forum Excel General
    Replies: 2
    Last Post: 06-15-2016, 02:10 AM
  4. [SOLVED] Simple Search for Value Function
    By amonty78 in forum Excel General
    Replies: 4
    Last Post: 06-10-2014, 08:21 AM
  5. create simple search
    By Armitage2k in forum Access Programming / VBA / Macros
    Replies: 3
    Last Post: 10-26-2009, 09:33 AM
  6. simple search macro
    By diesel20056 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2006, 02:05 PM
  7. Simple Search with UserForm
    By ski2004_2005 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2005, 09:42 AM

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