+ Reply to Thread
Results 1 to 14 of 14

VBA Highlight specific key words

  1. #1
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    VBA Highlight specific key words

    Hi all.

    I use the following code to highlight in red, certain keywords which appear in a sheet.
    There are many more, but I have just shortened it for this purpose.
    It works well, but it will highlight anything which contains the word e.g. TEA
    Like STEAM MOP.
    Or BOOKCASE and not just BOOK

    Is there a way to just highlight the specific word I have in the Comments

    Please Login or Register  to view this content.
    Thanks for looking

    Regards,

    Graham

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,864

    Re: VBA Highlight specific key words

    Please ignore.
    Last edited by Mumps1; 10-02-2022 at 11:03 AM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA Highlight specific key words

    Hi

    I tried that but it does not flag up, as the text on the sheet does not have a space after it.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,864

    Re: VBA Highlight specific key words

    Try:
    Please Login or Register  to view this content.

  5. #5
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,730

    Re: VBA Highlight specific key words

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)
    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.

  6. #6
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA Highlight specific key words

    Sorry, I was not aware about cross posting

    Here is the link to the other post

    https://www.mrexcel.com/board/thread.../#post-5955526

  7. #7
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA Highlight specific key words

    Thanks Mumps1

    It seems to take forever to run.
    I stopped it after a few mins.
    Is there a way to quicken it up.

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

    Re: VBA Highlight specific key words

    See if this is works,
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA Highlight specific key words

    Hi Jindon.

    This works great and is a lot faster than the one I had originally.
    Just one more question
    Is there a way to highlight the cell in green as well as the text being red.

    Regards,

    Graham

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

    Re: VBA Highlight specific key words

    Do you mean?
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA Highlight specific key words

    Hi Jindon.

    No, I want the cell to be filled with green and the specific text in Red

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

    Re: VBA Highlight specific key words

    Then adjust the bold lines
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: VBA Highlight specific key words

    Hi Jindon.

    This is perfect.

    Thanks for all your help.

    Regards,

    Graham

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

    Re: VBA Highlight specific key words

    You are welcome and thanks for the rep.

+ 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: 1
    Last Post: 04-15-2021, 12:01 PM
  2. [SOLVED] highlight specific range based on words in multiple sheets
    By ABDELFATTA in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-07-2020, 02:32 AM
  3. Replies: 1
    Last Post: 12-19-2017, 06:50 AM
  4. Replies: 15
    Last Post: 10-12-2014, 08:53 AM
  5. search & highlight specific words from list in workbook
    By venexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-27-2012, 02:34 PM
  6. Highlight cell with many words, with duplicates from row with single words.
    By Meows in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2010, 08:27 PM
  7. Highlight a row if a specific cell is specific numbers/words
    By sea0221 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-08-2005, 09:06 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