+ Reply to Thread
Results 1 to 9 of 9

Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    Dear Forum,

    I need to get the CELL ADDRESS of the Pivot Table in the Active Sheet, I need to basically display the values selected in the Pivot Table Page Filter for which Im using the below code, but I need to display it just right next to the Pivot Table leaving one Column in between.

    Please Login or Register  to view this content.
    I managed to get this code and tweaked it but i want to pass these values in the cell next to the Pivot Table Page Filter.

    Warm Regards
    e4excel

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent SAC
    Posts
    8,885

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    Why not make it a function that you simply put in that cell and pass the page filter cell to it as an argument?
    Rory

  3. #3
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    No I would like the code dynamically find the first Page Filter of the Active Sheet Pivot Table or any Pivot Table specified by the name in the code. I just need a small piece of code to get the cell address of the Page Filter , if there are more than one Page Filters in the Pivot Table then I need to get the CELL ADDRESS of all these Page Filters by their order..

    Moreover, I am no expert to write a Function in Excel VBA

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent SAC
    Posts
    8,885

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    May I ask why you wouldn't want a function that will update automatically when the filters are changed?

  5. #5
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    I would like to run this macro in every sheet with Pivot Tables and display what are the major selections in the Page Filter / Page Filters of each Pivot table and hence the code if could give me the cell address I would populate the earlier code with values in the cell 2 Columns away.

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    Can anyone help me the code please

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent SAC
    Posts
    8,885

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    Just add:

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    Can you just give me the code for the Page Filter cell address independently please as I need to just make a list of the cell addresses first.

    I think I got the answer after tweaking your code a bit,

    .Cells(lRow, 8).Value = pf.DataRange.Address.

    NOw just guide me how do I get the address in cases where there are more than one 1 Page filters used.
    Last edited by e4excel; 05-24-2019 at 02:26 PM.

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent SAC
    Posts
    8,885

    Re: Getting the CELL ADDRESS of Pivot Table Elements such as Page Filter

    You've already got a loop in your code to go through all the page fields, so just put the code in there.

+ 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. VBA Pivot Table Page Filter for OLAP Pivot
    By Bstone2015 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-13-2015, 10:54 AM
  2. Set the value of a Pivot Table Page Filter based on the calendar day
    By Wintery in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-11-2015, 02:17 AM
  3. Pivot Table - can't filter items in page area
    By seyss in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-01-2013, 11:33 AM
  4. Counting elements in a pivot table once a filter is set
    By Zealotwraith in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2013, 09:15 AM
  5. Replies: 0
    Last Post: 03-09-2011, 04:45 PM
  6. Problem setting pivot table page filter
    By VoiceOver in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2007, 09:47 AM
  7. How do I set up filter for page fields in pivot table?
    By Mitsycat in forum Excel General
    Replies: 3
    Last Post: 05-06-2005, 06:06 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