+ Reply to Thread
Results 1 to 10 of 10

Highlight entire row when word is in cell

  1. #1
    Registered User
    Join Date
    12-22-2008
    Location
    Missouri
    Posts
    39

    Highlight entire row when word is in cell

    What I want to do is select all rows that contain the word conveyor in it. So far I have managed to select all the cells, I have also managed to select the entire row but one row at a time, I have even been able to turn all the cells a different color but I just want to highlight them for other formatting, copying, and several other things that need to be done. I have other documents this could be very useful in too so i want to make it a generic multi-line highlight rather than adding the formatting into the formula.

    Can someone please help. Thank you in advance.
    Last edited by ladydubs; 05-12-2009 at 04:10 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Highlight entire row when word is in cell

    Hi,

    I think this is what you're after. Obviously you can swap "selection" out for any range you need

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    12-22-2008
    Location
    Missouri
    Posts
    39

    Re: Highlight entire row when word is in cell

    Its giving me the following error:

    Object variable or With block variable not set (Error 91)

  4. #4
    Registered User
    Join Date
    12-22-2008
    Location
    Missouri
    Posts
    39

    Re: Highlight entire row when word is in cell

    Sheet 1 contains columns a through g, in column f there is descriptions of work done. When the word "conveyor" appears in column f, i would like that entire row highlighted. I would like for all the rows that"conveyor" appears in to be highlighted at once. After they are selected, I want to copy out the rows into a new sheet.

  5. #5
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Highlight entire row when word is in cell

    I think u can use conditional formatting

    Look attached file.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Highlight entire row when word is in cell

    I tested it and it worked. Step 1 is to select your entire range (e.g. A1:G500) and then run the macro. Did you do that?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Highlight entire row when word is in cell

    try
    Please Login or Register  to view this content.
    remember you must select the range before running macro
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  8. #8
    Registered User
    Join Date
    12-22-2008
    Location
    Missouri
    Posts
    39

    Re: Highlight entire row when word is in cell

    Ok, so i see the error but don't know how to fix it. I should have specified, my bad.

    the cells that contain "conveyor" are not exclusive to the word "conveyor". It could say "Conveyor has stopped" or "Part is stuck in conveyor". The code works if "conveyor" is the only word in the cell not in a sentence.

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Highlight entire row when word is in cell

    You also might want to include (near the beginning of the macro) the line
    Please Login or Register  to view this content.
    if you are unsure as to whether the string you are looking for (conveyor) is actually in the range.

  10. #10
    Registered User
    Join Date
    12-22-2008
    Location
    Missouri
    Posts
    39

    Re: Highlight entire row when word is in cell

    martindwilson, thank you, that worked great. Thank you everyone that helped me with this. I can utilize this for so many projects i have going on.

    I appreciate it to the umpteenth degree.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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