title: How to let my VBA code skip the Application.Intersect function when there are no cells for the filter criteria?
body: <p>How do I let my my code skip the <code>Application.Intersect</code> function when there are no data points for the filter criteria? The error occurs at line 3 and 4 stating:
  <a href="https://i.stack.imgur.com/wDlLm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wDlLm.png" alt="Error"></a> </p>
  
  <p>I tried the (on line 3):
  <code>If IsError(Intersect(filterRange, filterRange.Offset(1, 0)).SpecialCells(xlCellTypeVisible)) = False Then</code> </p>
  
  <p>But it does not work. 
  I also tried: 
  <code>If Not IsError(Intersect(filterRange, filterRange.Offset(1, 0)).SpecialCells(xlCellTypeVisible)) Then</code></p>
  
  <pre><code>Set filterRange = Worksheets("JO_Pickups (Test)").Range("$A$1:$E$" &amp; Total_rows_JOPickTest) 'filter for less computations
  filterRange.AutoFilter Field:=2, Criteria1:=JO_id(i)
  If IsError(Intersect(filterRange, filterRange.Offset(1, 0)).SpecialCells(xlCellTypeVisible)) = False Then
      Set filteredRange = Intersect(filterRange, filterRange.Offset(1, 0)).SpecialCells(xlCellTypeVisible) 'remove headers
      If Not filteredRange Is Nothing Then
          For Each Area In filteredRange.Areas
              Worksheets("JO_Pickups (Test)").Range(Area.Address).Copy _
              Destination:=Worksheets("Help Worksheet").Cells(2, 1)
          Next Area
      End If
  End If
  </code></pre>