+ Reply to Thread
Results 1 to 6 of 6

Use conditional formatting on a range of cells

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    41

    Use conditional formatting on a range of cells

    Hello. What I am trying to do, is apply conditional formatting to a range of cells (for example, A2:J2) based on whether the data in one of the cells (D2) contains "Yes" or "No". I would like the entire range of cells to be one color if D2 contains "Yes", and another color if D2 contains "No". If needed, this can be split into 2 different conditional formatting rules.

    Thanks for the help!


    Andrew

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Use conditional formatting on a range of cells

    Edit Formatting Rule/Use a formula to determine which cells to format/=$D$2="yes"

    Edit Formatting Rule/Use a formula to determine which cells to format/=$D$2="no"

  3. #3
    Registered User
    Join Date
    09-28-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Use conditional formatting on a range of cells

    I apologize, I should have added more info. That does work, but I need the formula to affect an entire block of cells, highlighting a particular line based on column D in that row.

    For example, if D3 is "No", I need A3:J3 to be highlighted in red. If D25 is "Yes", I need A25:J25 to be highlighted green.

    If you need any additional info, please let me know.

    Thanks,


    Andrew

  4. #4
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: Use conditional formatting on a range of cells

    i think i got it now

    select the cells that you want to format based on $D$2 ie $d$3:$D$7

    conditional formatting/add new rule/use a formula to determine which cells to format/=$D$2="yes"

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Use conditional formatting on a range of cells

    assuming you want to apply this to a whole range of rows, you need to adjust the absolute reference...
    1. highlight the range you want to apply the conditional formatting to
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =$D2="Yes" and =$D2="No"
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    09-28-2012
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Use conditional formatting on a range of cells

    That worked great, thanks FDibbins.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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