+ Reply to Thread
Results 1 to 15 of 15

Easy way to search a sheet and highlight?

  1. #1
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Easy way to search a sheet and highlight?

    I'm just wonder if there is a simple way of creating a search box in a sheet, that when text is entered, will highlight anything matching within that sheet?

    I've looked, but every method people suggest seems complex.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    How about find Method? Ctrl+F


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?

    Yeah, my current method :D

    I would like a box within the sheet that I can use though.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    Ok fine... Just confirm us what needs to be done if there is a/multiple match(es)?

  5. #5
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?

    Well there shouldn't be more than one match, but if there is, perhaps highlight both?

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    I believe the word box refers to excel cell.

    Copy the below code and do right click on your sheet tab and select view code and paste the below code.

    In the suggested code change the cell reference C3 to your desired cell cell. Return to excel and do the entry and check....

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?

    Thank you for that.

    I copy and pasted the code as you said.

    However, entering something in the cell doesn't seem to do anything. Any ideas?

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    The matching cells of that sheet will be highlighted with green color background. Use Ctrl+F and check those matching cells background.

  9. #9
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?

    Hi,

    It doesn't seem to do anything. I will attach the file to this message for you to take a look at.

    Have I done something wrong?

    .xls Book1.xlsm

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    If Target.Address(False, False) <> "*C3*" Then Exit Sub
    What is this??? lol

    Please remove those stars from the above line...

    At the same time remove this line

    rFound.Select
    From the suggested code

  11. #11
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?

    Oh! I received an email from ExcelForum when you replied, and in that email it showed your code. Your code there shows the two stars, for some reason I just copy and pasted and didn't even notice them.

    Anyway, I removed them and it does work. However after an item is found, it remains highlighted, for some reason.

  12. #12
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    Oh! I thought you are trying some wild card combination

    Quote Originally Posted by Skiny View Post
    However after an item is found, it remains highlighted, for some reason.
    Not sure what you are trying to say with the above quoted sentence

  13. #13
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?



    I mean, if I search for something, the keyword is highlighted. If I search for another word, the old word also remains highlighted. Surely the old keyword should revert to black and white?

  14. #14
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Easy way to search a sheet and highlight?

    Replace the previous code with the below one.

    Just do double click on the cell to clear the background colors.

    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    08-03-2013
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    17

    Re: Easy way to search a sheet and highlight?

    Hey,

    Thanks very much for that.

    Although...it doesn't always clear the results. For example, I add MD313 to a cell. Then enter MD313 in the search cell. It finds it correctly, but when I double click the search cell again, it doesn't remove the background colour.

    Seems if I search for something with a number within it, it won't clear..

+ 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. Replies: 13
    Last Post: 08-02-2013, 04:11 PM
  2. Replies: 3
    Last Post: 04-23-2013, 06:49 PM
  3. Search and Highlight
    By karinos57 in forum Excel General
    Replies: 1
    Last Post: 06-23-2008, 01:49 PM
  4. Search and Highlight
    By ftlkid24 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2006, 02:24 PM
  5. Replies: 1
    Last Post: 05-22-2006, 05:10 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