title: PivotTable PageFilter and PivotItem Visibility
body: <p>I'm attempting to set the visibility of PivotItems not shown, when a PageFilter is set to <code>Visible = False</code>.</p>
  
  <p>The PivotTable looks as follows:</p>
  
  <p><img src="https://i.stack.imgur.com/VxSvz.png" alt="PivotTable Example"></p>
  
  <p>I'm requiring that any item not present after the PageFilter is set to "1" be hidden from the next portion of my code; which will loop through the (now) visible items present under "Consumable Name".</p>
  
  <p>I've only got as far as this:</p>
  
  <pre><code>Dim Pt As PivotTable
  Dim Pf As PivotField
  Dim Pi As PivotItem
  
  Set Pt = ActiveSheet.PivotTables("PivotTable1")
  Set Pf = Pt.PivotFields("Consumable Name")
  
  With Pt
      .PivotCache.Refresh
      .PivotCache.MissingItemsLimit = xlMissingItemsNone
  End With
  
  For Each Pi In Pf.VisibleItems
  'Do Stuff
  </code></pre>
  
  <p>This currently ignores the PageFilter that has already been placed on the table outside of VBA and simply cycles through all items, that would be in the PivotTable given no Filter.</p>
  
  <p>I think I'm missing the fact, that I haven't assigned PivotItems as visible or not, but not quite sure how to go about it!</p>