title: vba SpecialCells(xlCellTypeVisible) not working correctly when looping through pivot items in a filter
body: <p>I am using the below code to cycle through items in a filter in a pivot table and then copy the filtered results.</p>
  
  <p>But for some reason the code fails to account for the items that have no results and instead appears to copy the previous results instead.</p>
  
  <p>I have error handling in the code for the items that will show no results but it just doesn't seem to work - when walking through the code it skips the 'if' I have placed in there to catch the 'nothing'.</p>
  
  <p>It then (when it gets to the copying/pasting part of the code) copies the (now hidden) cells that were visible under the last item selected in the filter on the previous loop.</p>
  
  <p>I have missed off the end of the code as it gets a bit lengthy and it all works, it's just the bit with the visible cells I can't seem to get working.</p>
  
  <pre><code>Sub Bulletin_Chase()
  
  Dim pt As PivotTable
  Dim pi As PivotItem
  Set pt = Worksheets("By User").PivotTables("PivotTable1")
  
  Dim rng As Range
  Dim OutApp As Object
  Dim OutMail As Object
  Dim strbody As String
  
  For Each pi In pt.PageFields("Supplier").PivotItems
    pt.PageFields("Supplier").CurrentPage = pi.Name
  
  With Range("Filters")
      .AutoFilter Field:=2, Criteria1:=Array("false"), Operator:=xlFilterValues
  End With
  
  On Error Resume Next
  Set rng = Worksheets("By User").Range("Bulletin_List").SpecialCells(xlCellTypeVisible)
  
  If rng Is Nothing Then
      Worksheets("By User").AutoFilterMode = False
      Range("Filters").AutoFilter
      GoTo Continue
  End If
  </code></pre>
  
  <p>etc...</p>
  
  <p>Really struggling with this so any help at all from you geniuses would be greatly appreciated.</p>