Results 1 to 1 of 1

Pivot Table report filter

Threaded View

  1. #1
    Registered User
    Join Date
    02-11-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    98

    Pivot Table report filter

    Need some help on this one. First time doing anything w/ pivot tables since grad school....

    Basically I want to create a for loop where by the filter applied to the table changes w/ each 'i'. Naturally I will create a counter that can do this for me dynamically.

    a bit lost on how to do this one... need advice...note this is not all of my code, just the portion i need help w/

    sub data()
    
    'the filter that needs changing. Starts @ 0 goes to 25 in 5 yr increments
    g_period = 0
    
    Sheet2.Select
    
    ActiveSheet.PivotTables("PivotTable1").PivotFields("GuarPd").CurrentPage = _
            "(All)"
       
    
    ' i attempted to record this macro but i am getting an error
     With ActiveSheet.PivotTables("PivotTable1").PivotFields("GuarPd")
           .PivotItems(g_period).Visible = False
           .PivotItems(g_period+5).Visible = True
     End With
    i am trying to iterate through the different "guarpd"

    any help would be great. please and thanks. take care
    Last edited by dabrows; 06-06-2012 at 01:09 PM. Reason: solved

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