+ Reply to Thread
Results 1 to 2 of 2

Pivot Table conditional formatting using VBA

Hybrid View

Leonprivatemail Pivot Table conditional... 01-27-2010, 04:56 AM
Andy Pope Re: Pivot Table conditional... 01-28-2010, 08:58 AM
  1. #1
    Registered User
    Join Date
    01-27-2010
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    1

    Pivot Table conditional formatting using VBA

    Hi.

    I am extracting data from Access using MicroSoft Query. Due to volume of data, I am taking into a Pivot Table. The table contains a "Targets" field in Row, "Month" field in Column, and has a calculated item in Data.

    I need to change the colour & Bold of the values in Data based on whether it is <= 59% of Targets, Between 60% and 79% of Target, Between 80% and 100% of Target.

    On top of this, I need to formatting to be applied irrespective of where the Targets fied is in the Pivot, and it has to be applied everytime the pivot is updated.

    Att the moment I have it working using conditional formatting, but the moment my "Targets" is moved my formatting disappear.

    The pivot is built in Excel 2003.

    Thx
    Leon

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Pivot Table conditional formatting using VBA

    you could use code in the pivottableupdate event to re apply CF to the appropriate parts of the PT.

    Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
    
      ' Apply CF code
        
    End Sub
    Cheers
    Andy
    www.andypope.info

+ 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