title: Using arrays to Filter Pivot table labels
body: <p>Does anyone know a way to filter a PT label row based on an array of values. I tried this but got an error:</p>
  
  <blockquote>
    <p><em>Run-time error '5' - invalid argument or procedure call</em></p>
  </blockquote>
  
  <pre><code>Sub test()
  
  Dim PT As PivotTable
  Dim PF As PivotField
  Dim StrArr() As Variant
  
  StrArr = Array("89905-0496", "89905-0497", "89907-0492", "89587-0499", "89585-0498")
  
  Set PT = Sheet5.PivotTables(1)
  Set PF = PT.PivotFields("[HFM LEDGER ACCOUNTS].[CONCATENATED ACCOUNT].[CONCATENATED ACCOUNT]")
  
  PF.ClearLabelFilters
  PF.PivotFilters.Add2 Type:=xlCaptionEquals, Value1:=StrArr
  
  End Sub
  </code></pre>