+ Reply to Thread
Results 1 to 8 of 8

pivot table colour change per filter

  1. #1
    Registered User
    Join Date
    07-07-2019
    Location
    london
    MS-Off Ver
    2013
    Posts
    22

    pivot table colour change per filter

    Hi,

    much appreciate you help with this.

    can i assign a background colour to my whole pivot table, with that colour changing upon different selections of my filter. so i have a pivot table that filters by price. i wonder whether the whole background colour of the whole pivot table can change . i have 3 price filters of 0-5, 6-10, and 10+.

    many thanks for your help on this.

    i have google but the results are not quite what i was asking.

    thanks

    steve

  2. #2
    Registered User
    Join Date
    07-07-2019
    Location
    london
    MS-Off Ver
    2013
    Posts
    22

    Re: pivot table colour change per filter

    bump bump.

    no one have any ideas on this ??

    i thought this May be straght forward to do, but not from the explanations on google !!, suggesting programming formulae into it? is there not a solution ??

    thanks

    steve

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    4,977

    Re: pivot table colour change per filter

    It sounds like code would be the best option for this. Can you post a sample workbook so we can see what we're dealing with?
    Rory
    I drink, and I know things

  4. #4
    Registered User
    Join Date
    07-07-2019
    Location
    london
    MS-Off Ver
    2013
    Posts
    22

    Re: pivot table colour change per filter

    Hey Rorya, thanks for reply - just noticed it.

    i can only provide an example of the data. but i have cut the document, and attached.

    the source tab is the data.
    the actions tab is my table - of which - the key area is the "price" filter at the top. my question is can i change the colour of the whole table, to change colours upon each selection of price. so , eg, norm = yellow, high = red, low = blue.

    that would be fantastic to achieve but i cant seem to get that info anywhere.

    your help is greatly appreciated.

    regards steve

  5. #5
    Registered User
    Join Date
    07-07-2019
    Location
    london
    MS-Off Ver
    2013
    Posts
    22

    Re: pivot table colour change per filter

    example attached
    Attached Files Attached Files

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    4,977

    Re: pivot table colour change per filter

    Right-click the worksheet tab, choose View Code and then paste this into the window that appears:

    Please Login or Register  to view this content.
    You'll then need to save the workbook in a macro-enabled format.

  7. #7
    Registered User
    Join Date
    07-07-2019
    Location
    london
    MS-Off Ver
    2013
    Posts
    22

    Re: pivot table colour change per filter

    thanks v much rorya,

    it works on the attached example, however when i paste it into my main worksheet ( the actual file ) , the backgrounds go to a black colour.

    i didnt realise it required code, i thought it would be a selection from the tools somehow,.

    in hindsight i suppose i should have had just the border of the pivot table in different colours as the whole background is a little garish. is there a colour chart for code items ??, i assume im asking too much, as said didnt realize it was code i thought id be able to play around with the design a bit. many thanks anyway as what you have done has worked. i just need to tweak it, thanks

  8. #8
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    4,977

    Re: pivot table colour change per filter

    There was an error in what I posted before. This line:

    Please Login or Register  to view this content.
    should read:

    Please Login or Register  to view this content.
    Re the colours, you can use RGB values rather than literal constants - eg RGB(255,0,0) is the same as vbRed. If you want just borders, what border effect do you want? A border around the table, or each cell? It might be easier to create three pivot table styles with the colours you want and then apply them in the code. That way, if you want to alter the formatting, you can just amend the styles, not the code.

+ 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. Change filter pivot table
    By fiqarcobel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2019, 11:59 AM
  2. Change Chart Pivot series Colour depending from Pivot Table Filter value
    By BrianAll in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2018, 02:20 PM
  3. Change on Pivot Table Filter
    By BrianAll in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2017, 02:10 PM
  4. Replies: 6
    Last Post: 07-31-2014, 12:56 PM
  5. Replies: 3
    Last Post: 11-27-2013, 05:25 PM
  6. Pivot table, assigning a cell wo be change the Pivot table filter
    By jwongsf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2012, 05:00 PM
  7. Change Pivot table Filter Based on Cell Value *Multiple Filter items* Possible?
    By Flydd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2012, 06:57 AM

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