Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    9

    Unanswered: Conditional Formatting of Pivot Table?

    Is it possible to put conditional formatting on the cells of a pivot table so that records with a particular value in a 'Count of' column will be highlighted?

    Thanks. Nick.

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    is this excel we are talking about if so you can do this via some code

    Code:
    Sub test()
        Dim wrk4 As Worksheet
        Dim pvt As PivotTable
        Dim cell As Range
        
        Set wrk4 = Worksheets("Sheet4")
        Set pvt = wrk4.PivotTables(1)
        
        For Each cell In pvt.DataBodyRange
            If cell.Value > 5 Then
                cell.Interior.Color = vbRed
                cell.Font.Color = vbWhite
            End If
        Next cell
        
        Set pvt = Nothing
        Set wrk4 = Nothing
    End Sub
    this works with excel 2002
    i havent created an instance of excel or anything yet as i presume your linking via access to achieve this

    HTH
    Dave

  3. #3
    Join Date
    Aug 2004
    Posts
    9
    Thanks, but I wasn't using Excel - I actually meant when viewing a query in Pivot Table view.

    Nick.

  4. #4
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    I dont think you can as conditional format works on ranges in excel, and is not a function of pivottables themselves

    Hence i dont think there is anything equivalent in access
    you could try the web update for the pivottables to see if that can yield any results

    from the help file
    Formats that you apply to one element might affect similar elements. For example, if you change the text color for an item, all other items in the same field are formatted with the new text color.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •