+ Reply to Thread
Results 1 to 10 of 10

Coloring a row when a value is true

  1. #1
    Registered User
    Join Date
    06-08-2007
    Posts
    39

    Coloring a row when a value is true

    Dears,

    I need your help. I'm creating an HR form and I want to change the background of an entire row to, Let's say, Gray when an employee leave/quit. So if the cell value of (let's say) A40 is Quit/resign then A1.. bw1 will turn into gray otherwise leave alone.

    Your help is appreciated.
    Thanks
    Sam

  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,454

    Re: Coloring a row when a value is true

    Hi,

    Using conditional formatting, use the following formula to trigger the required format

    =OR($A1="Quit",$A1="Resign")
    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
    06-08-2007
    Posts
    39

    Re: Coloring a row when a value is true

    Your answer worked great, but for one row, when I tried to copy to the entire worksheet, on the cell that contains (Resigned/Quit) are colored in Gray. Can you apply conditional formatting on the entire worksheet?

    Thank you again.
    Sam

  4. #4
    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,454

    Re: Coloring a row when a value is true

    So, you want the whole sheet to be gray if cell A40 contains quit or resign?

  5. #5
    Registered User
    Join Date
    06-08-2007
    Posts
    39

    Re: Coloring a row when a value is true

    No, the sheet will look into cell A40 if it's true then the row from A1:BZ1 will turn gray, then if cell A6 is true then that row will turn gray.
    I used copy and paste special and used format to copy and paste, but in the condition box where it say "apply to:" A1:BZ1 is changing to A40 which means only the cell that contain Quit/Resigned is turning gray.

    Hope I didn't confuse the issue
    Sam

  6. #6
    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,454

    Re: Coloring a row when a value is true

    Sorry, I'm having a dim day.

    If A40 contains "Quit" or "Resign" Row 1 should be grayed out.
    If A6 contains "Quit" or "Resign" which row should be grayed out?

  7. #7
    Registered User
    Join Date
    04-28-2009
    Location
    california usa
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Coloring a row when a value is true

    Paste special doesn't work for me either. I found right after conditional format is entered you have the option on edit tab to repeat conditional format on another highlit column.
    For those interested the $ sign makes it apply to whole highlit colmn not just the first highlit cell.

  8. #8
    Registered User
    Join Date
    06-08-2007
    Posts
    39

    Re: Coloring a row when a value is true

    Sweep, Sorry I had to leave yesterday and couldn't reply back. In response to your question, row 6 will be grayed out.

    Johnnyx, I have specified under edit where it say apply to, to apply to the whole row. which it did. But now I want to apply to whole sheet, where if one quit or resign, you will select from the drop down and immediately the row will turn gray.

  9. #9
    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,454

    Re: Coloring a row when a value is true

    You'll need two different conditional format rules to achieve this.

    If A40 contains "Quit" or "Resign" Row 1 should be grayed out.
    Highlight row 1, and use the conditional formatting option to enter the formula =OR($A$40="Quit",$A$40="Resign")

    If A6 contains "Quit" or "Resign" which row should be grayed out?
    In response to your question, row 6 will be grayed out.
    Highlight row 6, and use the conditional formatting option to enter the formula =OR($A6="Quit",$A6="Resign")

  10. #10
    Registered User
    Join Date
    06-08-2007
    Posts
    39

    Re: Coloring a row when a value is true

    Thank you Dave, So there's no way to apply the condition to the whole sheet to make the row grayed out automatically everytime an employee change status from Active to Quite/Resigned (which being selected from the drop list)?
    How about macro of VPscript (which I'm not too familiar with them)?

+ 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