Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2005, 03:35 PM
Authorized User
 
Join Date: Dec 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Linking pivot tables

I wanted to find out if there was a way to link two or more pivot tables such that if the page criteria for one is changed then the rest would automatically change to the same selection. The pivot tables would be pulling data from the same data source.

I'm pretty sure that visual basic scripting is involved but not sure how to go about doing it. Thanks for any assistance.
 
Old July 25th, 2005, 01:57 AM
Registered User
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also intersted to know the solution since I am facing the same problem.How someone able to provide the guideline ASP.Thanks

 
Old August 6th, 2005, 02:56 AM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

put this code behind the sheet with the pivot tables on it, but first replace foo in the code with the name of your page field:

Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)

    Application.EnableEvents = False

    Dim pt As PivotTable

    For Each pt In ActiveSheet.PivotTables
        pt.PivotFields("foo").CurrentPage = Target.PivotFields("foo").CurrentPage.Name
    Next pt

    Application.EnableEvents = True

End Sub

 
Old July 24th, 2006, 01:25 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gdgonzal
Default

I gave this a try and it doesn't seem to work. Perhaps I'm doing something incorrectly. I have three .xls sheets within my workbook:

1. Has a "Summary" pivot table.
2. Has another pivot table based on the summary pivot table named "Historical".
3. Contains a flat file I've exported from Oracle 11i, named "Data", for which the summary pivot table is based on.

What I would like to do is to excluded certain rows from the "Summary" pivot table and as I do this I would like the second "Historical" table to reflect those changes. I think you have the answer but I'm implementing it incorrectly. Can you advise based on the above please? Thanks

Gary





Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking two similar pivot tables together exceldummy Excel VBA 1 May 2nd, 2007 10:09 AM
how to work pivot tables malli_kv2 Access 1 March 16th, 2007 06:34 AM
Formula in Pivot tables JPC Excel VBA 1 February 20th, 2007 01:27 PM
International Pivot Tables noldrini Excel VBA 0 February 8th, 2006 12:54 PM
Pivot Tables smartgir Excel VBA 0 May 12th, 2004 10:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.