1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Excel Macro to highlight words?

Discussion in 'Business Applications' started by Tannerx007, Jul 9, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. Tannerx007

    Tannerx007 Thread Starter

    Joined:
    Jul 9, 2012
    Messages:
    3
    Hey guys and gals,

    Here's what I'm trying to do: I have an Excel spread sheet with 3 columns and many rows depending on the data. I need to be able to search the data in column C for about 10 or so words and highlight them. The problem is, the words in column C have been exported by a program so each word ends with a comma then the next word begins with no space so it's difficult to search. Example, Text1,Text2,Text3 and so on. Is there a macro or software that I can use that will search all the rows for column C and highlight the group of words I choose? I'm using Excel 2007.

    Thanks for your help! :D
     
  2. etaf

    etaf Wayne Moderator

    Joined:
    Oct 2, 2003
    Messages:
    55,849
    are you searching for text1 in the example or for all words text1 and text2 and text3

    also what version of excel

    you can do with a large nested if for 10 words - but not on 2003 version or below

    problem is is looking for those characters so
    if you had

    doc,doctor
    a search for doc - would also pick up doctor

    ie Text10 would be found if you search for text1

    in a conditional format in cell C4 I put this
    Code:
    =IF(OR(ISNUMBER(SEARCH("text1",C4)),ISNUMBER(SEARCH("text2",C4)),ISNUMBER(SEARCH("text3",C4)),ISNUMBER(SEARCH("text4",C4)),ISNUMBER(SEARCH("text5",C4)),ISNUMBER(SEARCH("text6",C4)),ISNUMBER(SEARCH("text7",C4)),ISNUMBER(SEARCH("text8",C4)),ISNUMBER(SEARCH("text9",C4)),ISNUMBER(SEARCH("text10",C4)),ISNUMBER(SEARCH("text11",C4))),TRUE,FALSE)
    
    basically an IF statement to test for true or flase
    a search statement to find the text
    and isnumber to stop errors

    as i say this will return a true for text19
    as it can find the string text1
     
  3. Tannerx007

    Tannerx007 Thread Starter

    Joined:
    Jul 9, 2012
    Messages:
    3
    Well the Text1,Text2,Text3 etc. are actually people's names. I have a group of about 6 or 7 people that I need to find throughout all these columns so the names that I need to find are always the same but the total amount of names in Column C can vary. So to answer your question, I will need to extract certain names. For example, I want to search all the rows in column C and have only say Text1 and Text3 highlighted so that it would look like this: Text1,Text2,Text3 (Where the underline would be the highlighted part.) Does that make sense? I'm using Excel 2007.
     
  4. etaf

    etaf Wayne Moderator

    Joined:
    Oct 2, 2003
    Messages:
    55,849
    sounds like amacro is needed
    any reason you cant expand the text across columns so each cell has only one name

    text to columns and use the , as the deliminator would then move all that information, so that one name would move into a cell of its own
    then apply the conditional format
     
  5. Tannerx007

    Tannerx007 Thread Starter

    Joined:
    Jul 9, 2012
    Messages:
    3
    Hmm, I wasn't aware of that function. I'll try it tomorrow and see how it goes. Thanks for your help!
     
  6. etaf

    etaf Wayne Moderator

    Joined:
    Oct 2, 2003
    Messages:
    55,849
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1060277