Referencing row fields in pivot table

  • I don't use pivot tables much and have done even less in VBA and am struggling to sort something out in Excel 2010. My query is similar to the one asked here http://www.ozgrid.com/forum/showthread.php?t=159462 but none of the suggestions worked for me. Basically, if I have a PT with two row fields and I select a particular item in the second row field, how do I return the name of the "parent" entry in the first row field?


    In the attached example, the first instance of "BCD" should return "cliff", the second should return "fred" etc. forum.ozgrid.com/index.php?attachment/54603/


    TIA

  • Re: Referencing row fields in pivot table


    Quote

    "BCD" should return "cliff"


    Return something in response to what kind of query?
    What are the output formats?
    Are you looking for Tables, formulas, VBA code?

  • Re: Referencing row fields in pivot table


    Thanks for your response Herbds7. I was envisaging VBA, because I imagined this wouldn't be possible using formulae, but if that works happy to consider. I was thinking of the input as embedded in VBA code (or a parameter in a UDF). The result would be the name of the entry in the first (upper) pivotfield. Does that answer your questions?

  • Re: Referencing row fields in pivot table


    Do you always want the first pivot field, or the one above the referenced item? If the latter, then something like this:

    Rory
    Theory is when you know something, but it doesn’t work. Practice is when something works, but you don’t know why. Programmers combine theory and practice: nothing works and they don’t know why

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!