+ Reply to Thread
Results 1 to 12 of 12

Shading whole row based on value in one column

  1. #1
    Registered User
    Join Date
    07-28-2014
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    3

    Shading whole row based on value in one column

    How do I shade a whole row based on the value in one of the columns? Thanks

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Shading whole row based on value in one column

    Use Conditional Formatting.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Shading whole row based on value in one column

    Use Conditional Formatting

    Assuming row A should be shaded based on A1 being "ABC"...

    Select the cells on row A you want shaded.

    Conditional Formatting
    New Rule
    Use a formula to determine...

    =($A$1="ABC")
    format as required.

    Use Format painter to copy the format to other rows.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Shading whole row based on value in one column

    @Special-K: rows are usually referred to by number and columns by alphabet so it's a little confusing if you transpose them.

    But to build on the suggestion, you could select all the rows and columns at once and then use the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Shading whole row based on value in one column

    Good point, I meant row 1 not row A

  6. #6
    Registered User
    Join Date
    07-22-2014
    Location
    scotland
    MS-Off Ver
    2010
    Posts
    8

    Re: Shading whole row based on value in one column

    Thanks for the help but its only changing that certain cells colour I need to do the full row, so if it says connected all of that row automatically turns green. Is this possible.

    Thanks

    dave

  7. #7
    Registered User
    Join Date
    07-22-2014
    Location
    scotland
    MS-Off Ver
    2010
    Posts
    8

    Re: Shading whole row based on value in one column

    Thanks for the help but its only changing that certain cells colour I need to do the full row, so if it says connected all of that row automatically turns green. Is this possible.

    Thanks

    dave

  8. #8
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Shading whole row based on value in one column

    Clear the Conditional Formatting you already have.

    Select ALL the cells you want to change colour on your selected row
    formula
    =($A1="ABC")
    and format as required

    ALL the cells you selected should change colour when that condition is true.

  9. #9
    Registered User
    Join Date
    07-28-2014
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Shading whole row based on value in one column

    Thanks all. It works perfectly when I select the first row and apply conditionally formatting, but when I copy the format to subsequent rows they also automatically shade when they don't meet the criteria. It seems to still use the value from row 1 as opposed to the value of that column on the subsequent row. How do I tell it to look for the value of the column on the respective row?

  10. #10
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Shading whole row based on value in one column

    I think you need to remove the second $
    so it's like

    $A1
    rather than
    $A$1

    Then use Format painter

  11. #11
    Registered User
    Join Date
    07-28-2014
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    3

    Re: Shading whole row based on value in one column

    You're not wrong! I have one happy colleague now. Thanks very much.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Shading whole row based on value in one column

    Yes, it's
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    as opposed to
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and you don't need the brackets so
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And, as I said, if you use that formula, you can select all the rows and columns starting with cell A1 and apply the formatting in one go.

    As Special-K suggested, it would be a good idea to check and, if necessary, remove any other CF affecting those cells.

    Regards, TMS

+ 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. Shading cells based on Row 1 value
    By gomesy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2009, 07:24 AM
  2. [SOLVED] Conditional Cell Shading (based on the shading of other cells)
    By Tubby in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-20-2006, 05:10 PM
  3. Changing shading based on a row above
    By matpj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2006, 09:26 AM
  4. Column based cell shading
    By rbmcc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-06-2006, 01:27 PM
  5. [SOLVED] shading a rowwhen a time is entered but no shading when 0 is enter
    By fomula problems in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-23-2005, 04:05 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