+ Reply to Thread
Results 1 to 12 of 12

Fill background color subtotal row

  1. #1
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Fill background color subtotal row

    Hello hope you can solve my little problem here. I got the code but I don't know how I can apply background color to the rows with subtotal word,including the "grand total". Sorry if I can't explain it well.

    Please Login or Register  to view this content.

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

    Re: Fill background color subtotal row

    Try this:

    Please Login or Register  to view this content.

    Regards
    Last edited by TMS; 08-05-2011 at 05:41 PM.
    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 Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Fill background color subtotal row

    Is there a way I can change the color of it?And what if I want to filter only Column B to L.and I just notice the last subtotal row and grand total didn't include to change the background color.thanks for helping, sorry If I just replied too late

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

    Re: Fill background color subtotal row

    Of course, just change the line:

    Please Login or Register  to view this content.

    Record a macro while you change the colour of a cell to the colour you want. That will give you the number you want.

    The following code changes interior colour to red, yellow, green and blue.

    Please Login or Register  to view this content.

    Regards

  5. #5
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Fill background color subtotal row

    Thank you so much...I work perfectly

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

    Re: Fill background color subtotal row

    You're welcome.

    If this has answered your question, please mark your thread as solved. See my signature for details or the FAQ.

    Regards

  7. #7
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Fill background color subtotal row

    Hello again. It really works but then I noticed something,I just want to fill color from column B to L, and I noticed that I can't removed or change the background color of other column like column M to P, is there something wrong with the code?thanks

  8. #8
    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,411

    Re: Fill background color subtotal row

    I'm sorry, I have no idea ... I have no data to work with so I can't even guess at what is happening.

    Probably worth posting a new thread with a sample workbook and re-iterating the requirement.

    Regards

  9. #9
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Fill background color subtotal row

    Here is the sample workbook.I already include all the code you given me. I already modify the code that it will start to fill color on column b but then column A still have fill color and I can't change it
    Attached Files Attached Files
    Last edited by emina002; 08-17-2011 at 06:27 PM.

  10. #10
    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,411

    Re: Fill background color subtotal row

    Select column A by clicking on the "A" at the top of the column.
    Click on the Conditional Formatting icon.
    Select Clear Rules
    Select Clear Rules from Selected Cells


    The following code will remove the subtotals:

    Please Login or Register  to view this content.

    Note that, in the original code, the second:

    Please Login or Register  to view this content.

    should be:

    Please Login or Register  to view this content.

    As for columns M onwards, I expect you can do the same as with column A.

    Regards

  11. #11
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: Fill background color subtotal row

    Ok thanks I will do that and respond if it works properly

  12. #12
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: Fill background color subtotal row

    An alternative just for the conditional formatting (not the subtotal):
    Select the entire columns B - L and enter the conditional format formula:
    Please Login or Register  to view this content.
    Ben Van Johnson

+ 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