locked
Get all elements listed in a pivot table filter (page field) with VBA. RRS feed

  • Question

  • Hello everyone.

    I need to print a PDF output for each name in the page field list (highlighted in the image below). It shouldn't be the best approach, but I thought I'd get the list with all the available names and go filtering with a vba loop.

    The problem I can not get this list. Any tips?


    https://inframicrosoft.wordpress.com/

    Thursday, November 7, 2019 12:01 PM

All replies

  • the closest I got was with the code below:

    For Each Item In pvt.PivotFields("[LANC].[NAME].[NAME]").VisibleItemsList
        Debug.Print Item
    Next

    The problem that only works by selecting n-1 from the n elements in the list. If you select all, the field is set to "all" and VisibleItemsList returns an empty element.


    https://inframicrosoft.wordpress.com/


    Thursday, November 7, 2019 6:29 PM
  • Hi,

    Considering the issue is mainly related to VBA, to help you resolve the issue better, I will move the thread to Excel for developers. You may get more helpful replies there. Thanks for your kind understanding. 

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Best Regards,

    Emily


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Office 2019.

    Friday, November 8, 2019 2:33 AM
  • Hi,

    Considering the issue is mainly related to VBA, to help you resolve the issue better, I will move the thread to Excel for developers. You may get more helpful replies there. Thanks for your kind understanding. 

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Best Regards,

    Emily

    Thank you so much for this. I just didn't find the best categorization option. I really hope someone can help me, because I've exhausted my attempts.


    https://inframicrosoft.wordpress.com/

    Friday, November 8, 2019 3:04 AM