+ Reply to Thread
Results 1 to 8 of 8

PivotTable cells losing colour when changing filter/refreshing.

  1. #1
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    PivotTable cells losing colour when changing filter/refreshing.

    Hoping someone can help with a (hopefuly) obvious answer.

    We have a large table of data (about 500 rows and 30 columns).
    I wanted to put this into a pivot table to display the information more easily.
    Once I have selected the table, and created the pivot table, I tick most of the boxes to show the data.
    This looks a mess.
    So I make it tabular format and remove all subtotals/totals and it looks more like a table. Great stuff.
    But, as soon as I add colour to the columns of the pivot table, it seems to bug out.

    So column B is all orange, C blue and D purple.
    Once I have coloured these columns, if I use the filter on the row to untick an entry that I don't want to see, random cells lose their colour. (The preserve formatting tick box was already checked).

    Over a large table with 30 columns, this looked crazy and made no sense.
    Cells lost colour, some were coloured all black, some text turned grey.

    I thought I was an issue with the original table (which is coloured) so I copied the data to a new tab, pasted as values and had it just as text.
    The pivot table still acts crazy when refreshing and I am baffled to why.
    Because of this, I am unable to have the table how I want.

    Any ideas on this?

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: PivotTable cells losing colour when changing filter/refreshing.

    Hi,

    You'll have to use code to reset the colours for the columns when the pivot table updates.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: PivotTable cells losing colour when changing filter/refreshing.

    The end game would be (if possible) for the pivot table to take the formatting of the source cell and bring it along. Is this possible?

    I am trying to make a database that is accurate and looks good, but the visual side is annoying me.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: PivotTable cells losing colour when changing filter/refreshing.

    Unfortunately, when the pivot table reduces in size, the "new" cells that are revealed use the default Normal cell style rather than whatever style might have been applied to them previously. You would require code that, for example, replaced the cell styles in each column with the style of the first cell in that column (or any other chosen cell that you could store the required styles in).

    It shouldn't be terribly difficult to code if you can provide some idea of the layout of the sheet.

  5. #5
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: PivotTable cells losing colour when changing filter/refreshing.

    Sounds just what I need.
    You asked for the layout of the sheet, which information to you specifically need?
    I can try to obtain all information in one go rather than a back and forth.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: PivotTable cells losing colour when changing filter/refreshing.

    Basically just which columns you want coloured (or if it's all of them that's even easier) and which row it can pick up the required formatting from.

  7. #7
    Forum Contributor
    Join Date
    08-23-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    128
    Quote Originally Posted by xlnitwit View Post
    Basically just which columns you want coloured (or if it's all of them that's even easier) and which row it can pick up the required formatting from.
    Ok. I will make up a temp spreadsheet to show the columns. How would this function? Would only the pivot table cells be coloured or the entire column? I ask because i planned on sticking information under the table?

    Also, if one cell in a row contains data, the entire row needs to be red. This also doable?

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: PivotTable cells losing colour when changing filter/refreshing.

    It would be entirely up to you as to what gets coloured.

+ 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. PivotTable source error, but data is refreshing
    By Guest82943 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 03-20-2014, 11:58 PM
  2. Replies: 3
    Last Post: 02-13-2014, 06:31 AM
  3. Changing PivotTable Filter with VBA
    By elflacoalto in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-29-2011, 08:51 AM
  4. Changing a cell's colour basing on other cells' colour
    By rhua5436 in forum Excel General
    Replies: 11
    Last Post: 09-23-2010, 05:49 AM
  5. PivotTable Not refreshing when Report filter selection is changed
    By newbie11 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2009, 06:58 PM
  6. Replies: 4
    Last Post: 03-02-2009, 06:43 PM
  7. Changing PivotTable cells in VBA
    By stuartmarsh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2006, 03:30 AM
  8. [SOLVED] Pivottable - dynamically changing the range of cells
    By Todd1 in forum Excel General
    Replies: 1
    Last Post: 03-28-2006, 01:30 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