+ Reply to Thread
Results 1 to 4 of 4

Getting Pivot Table Hierarchy Using Excel VBA

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Getting Pivot Table Hierarchy Using Excel VBA

    Hi,

    Is there a way for getting Pivot Table Hierarchy using Excel VBA?

    For Example, in the attached image, the text marked in yellow is the Hierarchy which I am trying to extract. Similar to what GetPivotData would do when clicked on a cell on the Pivot Table.

    Any guidance would be much appreciated.
    Attached Images Attached Images
    Cheers!
    Deep Dave

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Getting Pivot Table Hierarchy Using Excel VBA

    Try:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Getting Pivot Table Hierarchy Using Excel VBA

    Hi Olly,

    Thank you for the reply. I have left office, I will check and revert tomorrow morning.

    Thank you for your time..

    Cheers!

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,879

    Re: Getting Pivot Table Hierarchy Using Excel VBA

    HI,

    I have tested your code, and it works in almost all cases. When you click on a Cell where there is no rating, just the currency, it returns only the currency.

    I did manage to figure out the solution I was looking for by using the code below.

    Please Login or Register  to view this content.
    Thank you for the help.. Rep added & thread marked as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Access Pivot Table Hierarchy In Report Filter
    By NeedForExcel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-09-2015, 06:55 AM
  2. Areas in pivot table columns using the same row hierarchy
    By RiddlerAtWork in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-26-2014, 08:05 AM
  3. Need help changing basic chart into a hierarchy chart/table in Excel 2010
    By attaboy000 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 06-04-2014, 05:26 AM
  4. Excel 2007 : 07 Pivot Table Change to hierarchy?
    By mashley in forum Excel General
    Replies: 0
    Last Post: 11-07-2008, 01:25 PM
  5. hierarchy filters in pivot table
    By yossiybi in forum Excel General
    Replies: 5
    Last Post: 07-13-2008, 09:55 AM
  6. hierarchy between filters in pivot table
    By yossiybi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2008, 06:26 AM
  7. [SOLVED] Pivot Table (same level hierarchy fields)
    By goofy11 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-14-2005, 03:05 PM

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