+ Reply to Thread
Results 1 to 3 of 3

Match partial word instead of all or nothing

  1. #1
    Registered User
    Join Date
    06-28-2017
    Location
    New York, USA
    MS-Off Ver
    2010
    Posts
    2

    Match partial word instead of all or nothing

    Hi there! I was looking at what is now a closed thread here, and found this lovely bit of code. The only problem I've been having with it is that it changes the font of only an exact word but if the word is part of another word the macro won't touch it. Eg if a cell contains "I have a cat" it will change to "I have a cat" but if the cell contains "I have cats" it will remain "I have cats". How would you modify this code so that the word's font will change even if it is contained within another word: "I have cats"

    Please Login or Register  to view this content.
    I tried modifying a bunch of stuff on line:
    Please Login or Register  to view this content.
    but nothing seemed to work. Any help would be greatly appreciated!

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Match partial word instead of all or nothing

    I might be totally wrong about this, but.....I'm not sure there is a way to do what you are asking because it would change all words that had cat in it, like category, to red font. I think you might have to go to the myList line and add in the words you want changed, as well as the myColor line to add the colors.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Registered User
    Join Date
    06-28-2017
    Location
    New York, USA
    MS-Off Ver
    2010
    Posts
    2

    Re: Match partial word instead of all or nothing

    Yeah, that's what I was kind of concerned about doing. I'd be okay with a solution that did highlight the entire word, like category though. But I'll consider adding extras to the mylist (and mycolor) line as you suggested, thanks!

+ 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] Nesting if statements when a partial word match is found
    By knakw00 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2018, 03:27 PM
  2. [SOLVED] Lookup partial values and if match return partial value from another cell
    By Renejorgensen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-01-2017, 07:53 AM
  3. VBA: Find all sentences with a given word. Partial match preferred with regex.
    By first_jaguar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2017, 02:26 PM
  4. Replies: 3
    Last Post: 01-22-2015, 06:21 PM
  5. Copy column based on partial word match in first row and paste into existing workbook
    By David Harris 1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-19-2013, 03:52 PM
  6. Copy column based on partial word match in first row and paste into existing workbook
    By David Harris 1987 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2013, 01:02 PM
  7. Replies: 4
    Last Post: 04-26-2011, 04:38 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