+ Reply to Thread
Results 1 to 4 of 4

Pivot Table double click extract/ GETPIVOTDATA()

  1. #1
    Registered User
    Join Date
    08-04-2007
    Location
    London
    MS-Off Ver
    work: 2003, home: 2008 for Mac
    Posts
    32

    Question Pivot Table double click extract/ GETPIVOTDATA()

    Hi All,

    I have a spreadsheet that pulls data through from a pivot table into a different format on a frontpage. This absolutely has to be done in this way, there isn't an alternative to this.


    I am doing this by using the GETPIVOTDATA() function and this works fine, however I want to also replicate the functionality where you can double click on the pivottable result to show the lines of data that make up the result.

    I know I'm going to have to use VBA for this, however I can't find the function that I need to do this..!! can anyone help?

    thanks in advance

  2. #2
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Pivot Table double click extract/ GETPIVOTDATA()

    Hi Zonino

    Try recording a macro when you double click the pivot table. You'll get the following code:

    Please Login or Register  to view this content.
    Dion

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

    Re: Pivot Table double click extract/ GETPIVOTDATA()

    To drill through you would (I suspect) first need to find the cell in the PT and determining the cell to which the GETPIVOTDATA function is pointing seems to me at least to be pretty complex given the flexibility inherent in PT design, ie:

    a) a given field may appear multiple times in any PT
    (used in row & data fields etc...)

    and

    b) the criteria for a given field may appear multiple times (aggregation) - establishing the correct one is thus potentially convoluted.

    Now it's feasible you could find the output of the GETPIVOTDATA function within the Data Value range and then compare the various field properties of the found cell to those contained in the function itself ...
    If you knew the output values were unique then it's obviously a little more straightforward but if you can't make that assumption there's a lot more work to be done.

    Will Riley posted a version of the above here: http://www.ozgrid.com/forum/showthread.php?t=30296 however this method does (in present form) assume unique values.
    Last edited by DonkeyOte; 11-14-2009 at 05:06 AM. Reason: typo

  4. #4
    Registered User
    Join Date
    08-04-2007
    Location
    London
    MS-Off Ver
    work: 2003, home: 2008 for Mac
    Posts
    32

    Re: Pivot Table double click extract/ GETPIVOTDATA()

    Thanks for the input,

    I've been working my head around this for the last few days and have come up with an alternative solution, which is actually preferable for the target audience as well (success!)

    I have some VBA script that applies the autofilter function to the source data (which is all contained within the workbook), which when I find/work out code to populate my parameters (I need to work out how to grab the data from column B on the row I've clicked on, wherever I've clicked, i.e. if I click C6 or XZ6 it will still return the value for B6) will provide the functionality I need, and make it easy for people to change their mind about what they want to look at. woop

+ 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.6.0 RC 1