+ Reply to Thread
Results 1 to 8 of 8

Linking Pivot tables - Multiple Page Fields

  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:

    Please Login or Register  to view this content.
    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.

  2. #2
    Registered User
    Join Date
    03-08-2007
    Posts
    93

    Re: Linking Pivot tables - Multiple Page Fields

    I have several sheets that do this - you should be able to just add each new element as follows:

    Please Login or Register  to view this content.
    Good Luck

    SAE

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

    Re: Linking Pivot tables - Multiple Page Fields

    Thanks for the help, but something must not be right. I copy/pasted your code and still only the SLS_MDL field will change for both tables. I even switched the order so origin was strField and still just the SLS_MDL one did it as strField2...that doesn't really seem to make sense.

    Any thoughts? I can attach a copy of the file if that would help

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Linking Pivot tables - Multiple Page Fields

    Posting a sample is always a good idea... though not really any different than prior post the below is a slight variation in terms of processing multiple page fields of interest:

    Please Login or Register  to view this content.

    EDIT: worth adding that the above is not designed for use wherein multi item selection is active on the Page Field (ie hidden items pre XL2007)

    It's always worth outlining version... 2007 and beyond are quite different in many respects to their predecessors - esp. in regard to PTs
    Last edited by DonkeyOte; 02-19-2010 at 03:48 PM.

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

    Re: Linking Pivot tables - Multiple Page Fields

    Still no dice...just the SLS_MDL changes. I'm not sure if I fell into the disclaimer you listed. This workbook was made in Excel 2003...Here's a sample of the file.

    Thanks

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

    Re: Linking Pivot tables - Multiple Page Fields

    forgot the file...
    Attached Files Attached Files

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Linking Pivot tables - Multiple Page Fields

    Sorry for delay - "out of hours" for me now I'm afraid.

    Regards your file... first off you have the latest code in the wrong sheet object (you're still running the original code against the Pivot)

    Regardless, given you're hiding items in the Page Field you will need to adopt a more sophisticated approach ... ie SLS_MDL won't update to reflect changes (the others should)

    Unfortunately pre XL2007 you can't iterate the items within the Page Field and test the visibility status... in reality you need to change the orientation (temporarily) of the field from Page to Row, iterate each item within the Row field (and set visibility) before subsequently moving field back to Page field... in short a "faff".

    In the attached link I had put together some code - but not really tested a great deal and so I'm sure it will fail under certain circumstances

    http://www.excelforum.com/2190338-post12.html

    I will look at this tomorrow applying the above principles...

    the good thing here is that the PTs have the same data source so there shouldn't be issues of items in one PT field not appearing in the same field in the other PT.

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

    Re: Linking Pivot tables - Multiple Page Fields

    Hey all. I got it working. I stopped hiding items in the Page Field (and put in the right code) and it worked. Many thanks to everyone that posted

+ Reply to Thread

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