+ Reply to Thread
Results 1 to 2 of 2

Thread: Repeat Pivot Table Page Fields in a 2nd Worksheet

  1. #1
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    153

    Repeat Pivot Table Page Fields in a 2nd Worksheet

    Hi,

    I have a pivot table with page fields on Sheet1.

    In Sheet2 I have data (that is not and cannot be in a table format) which is linked to and calculated by the pivot table in Sheet1.

    Is it possible to repeat the pivot table page fields in Sheet1 in Sheet2 (synchronised is fine) so that users can control what they view in Sheet2 whilst on Sheet2.

    Many thanks

  2. #2
    Forum Contributor
    Join Date
    04-11-2008
    Posts
    153
    Hi,

    I have found/adapted the following code but I cannot get it to work exactly as I want.

    Currently the code will make any manual selection of the slave field the same as the master field. However, I want the selection in either the master or the salve to automatically synchronise with the other (which I suppose means both are masters).

    Is this possible?

    Many thanks

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
    Dim myMaster As PivotTable
    Dim mySlave As PivotTable
    
    Set myMaster = Worksheets("Sheet2").Range("A1").PivotTable
    
    Set mySlave = Worksheets("Sheet1").Range("A1").PivotTable
    
    mySlave.PivotFields("Region").CurrentPage = myMaster.PivotFields("Region").CurrentPage.Name
    
    End Sub

+ 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.2.0