Results 1 to 8 of 8

Linking Pivot tables - Multiple Page Fields

Threaded View

  1. #1
    Registered User
    Join Date
    10-27-2008
    Location
    Illinois
    Posts
    27

    Linking Pivot tables - Multiple Page Fields

    Hi all,

    I have two pivot tables on one sheet and I want the page fields on the second to change when I change the first pivot table. I found the below code and have applied it to one of the three page fields I have, but can't seem to duplicate it for the other page fields:

    Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
    Dim ptTable As PivotTable, strField As String
    strField = "SLS_MDL"
    On Error GoTo ExitPoint
    Application.EnableEvents = False
    For Each ptTable In ActiveSheet.PivotTables
        If ptTable <> Target Then
            ptTable.PageFields(strField).CurrentPage = Target.PageFields(strField).CurrentPage.Value
        End If
    Next ptTable
    ExitPoint:
    Application.EnableEvents = True
    End Sub
    You can see in the code that my page field is "SLS_MDL". I also have the fields "origin" and "destination" I'd like to have change in both places.

    Thanks!
    Last edited by mettekr; 02-22-2010 at 09:50 AM.

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