Results 1 to 5 of 5

Conditional formatting applied to a pivot table doesn't work as it should

Threaded View

Pichingualas Conditional formatting... 03-09-2012, 02:44 PM
Pichingualas Re: Conditional formatting... 03-12-2012, 08:38 AM
OnErrorGoto0 Re: Conditional formatting... 03-12-2012, 09:14 AM
Pichingualas Re: Conditional formatting... 03-13-2012, 02:03 PM
Pichingualas Re: Conditional formatting... 03-14-2012, 07:43 AM
  1. #1
    Forum Contributor
    Join Date
    02-07-2012
    Location
    MIA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    429

    Conditional formatting applied to a pivot table doesn't work as it should

    Hello everyone

    I have a problem concerning conditional formatting and pivot tables.

    After executing the following macro:

    Sub ConditionalFormat()
        Range("A1:" & ExcelColNonRec(ActiveSheet.Columns.Count) & CStr(ActiveSheet.Rows.Count)).FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, _
            Formula1:="=0"
        With Selection.FormatConditions(1)
            .Font.Color = -16383844
            .Font.TintAndShade = 0
            .Interior.PatternColorIndex = xlAutomatic
            .Interior.Color = 13551615
            .Interior.TintAndShade = 0
        End With
        Selection.FormatConditions(1).StopIfTrue = False
    End Sub
    Function ExcelColNonRec(ByVal intCol As Long) As String
        While (intCol > 0)
            intCol = intCol - 1
            ExcelColNonRec = Chr(65 + (intCol Mod 26)) + ExcelColNonRec
            intCol = intCol \ 26
        Wend
    End Function
    on a sheet which contains a pivot table, it happens exactly what I want which is negatives get shaded. But if after that you expand any of the categorys within the pivot table, the selection to which the conditional format is applied changes and it no longer works, even when the categorys are closed again.

    Can any of you think of a solution to this, so that the conditional format will be applied to all the cells of the pivot table, even when you expand or close each category?

    Thanks in advance
    Last edited by Pichingualas; 03-13-2012 at 02:04 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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