Results 1 to 11 of 11

Synchronize 2 Pivot Tables with a Combo Box

Threaded View

  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    Long Beach
    MS-Off Ver
    Excel 2003
    Posts
    15

    Synchronize 2 Pivot Tables with a Combo Box

    So I am using this (http://datapigtechnologies.com/flashfiles/pivot10.html) tutorial to synchronize a few pivot tables in one of my workbooks. But it doesn't work correctly because not all my tables have the same values. For example: The matching column name is RepName, and I have multiple tables with RepName as a column, but not all reps are in all tables. I'd like it to select (all) if one of the pivottables does not have a rep. Any help? Excel 2003, but if you guys have a better 2007 code, then I can use 2007.

    Sub ChangePivots()
    '
    ' ChangePivots Macro
    ' Macro recorded 3/21/2012 by config
    '
    '
        ActiveSheet.PivotTables("PT1").PivotFields("SalesRepName").CurrentPage = Range("M1").Text
        ActiveSheet.PivotTables("PT4").PivotFields("SalesRepName").CurrentPage = Range("M1").Text
    
    
    
    
        On Error GoTo Err_SomeName2
         ActiveSheet.PivotTables("PT2").PivotFields("SalesRepName").CurrentPage = Range("M1").Text
        On Error GoTo Err_SomeName2
        
    Pivot3:
         
        On Error GoTo Err_SomeName3
        ActiveSheet.PivotTables("PT3").PivotFields("SalesRepName").CurrentPage = Range("M1").Text
        On Error GoTo Err_SomeName3
       
    GoTo TheEnd
    
    
    
    Err_SomeName2:
        ActiveSheet.PivotTables("PT2").PivotFields("SalesRepName").CurrentPage = Range("(All)").Text
        
    Resume Next
        
    Err_SomeName3:
        ActiveSheet.PivotTables("PT3").PivotFields("SalesRepName").CurrentPage = Range("(All)").Text
        
    
    
    Resume Next
    
    TheEnd:
    End Sub
    Last edited by sanchdaniel; 04-12-2012 at 01:57 PM. Reason: SOLVED
    Excel 2003 and 2007

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