+ Reply to Thread
Results 1 to 7 of 7

Colouring areas depending on column values

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    18

    Colouring areas depending on column values

    Dear Excel Forum,

    I have spreadsheet with different data areas separated by a row, where I'd need to fill the whole area with different colours, depending on the values of column D (per area). If the values are all exact same, the area should be coloured green, if not, it should be coloured red.

    Please also note, on column E I have marked X's next to lines. This X means the line shouldn' be used in the comparison, but should still be coloured aswell.

    If there is only one row in an area (meaning nothing to compare to, excluding rows with X), the area should be coloured green by default.

    Attached an example spreadsheet. On the Desired outcome -tab I have deliberately bolded the rows to indicate which values were used for the comparison (the macro does not need to do this)

    Example_2.xlsx

  2. #2
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Colouring areas depending on column values

    Here you go
    Please Login or Register  to view this content.
    Code is sutitable for Excel 2003, will be OK in 2007 on
    If it works for you, please click the star. If not I'll try harder.

  3. #3
    Registered User
    Join Date
    09-10-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Colouring areas depending on column values

    edit: solved
    Last edited by tuppari; 10-26-2012 at 05:25 AM.

  4. #4
    Registered User
    Join Date
    09-10-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Colouring areas depending on column values

    One more thing: I found a slight bug, if an area has every line marked with X, it sort of combines itself with the area below, even colouring the empty row between them. What do I do?

  5. #5
    Registered User
    Join Date
    09-10-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Colouring areas depending on column values

    Bump, here is an example of the error;

    11249615.jpg

  6. #6
    Registered User
    Join Date
    09-10-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Colouring areas depending on column values

    edit: doublepost by accident

  7. #7
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Colouring areas depending on column values

    Here is corrected code; I think I understand the requirement better now after losing the code 3 times!
    Please Login or Register  to view this content.

+ 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