title: Using the IsEmpty function in VBA
body: <p>I've been having some issues trying to clear a filter that I installed.</p>
  <p>It's purpous is to show all the data inside the data base if a certain range of cells are empty.</p>
  <p>I got it to a point where if I use a single cell as reference it will use the code as intended, but if I try a range with multiple cells it will always ignore the first part of the if statement</p>
  <pre><code>Dim rgData As Range, rgCriteria As Range
  
  Worksheets(&quot;Pipeline&quot;).Activate
  
  If IsEmpty(Range(&quot;G2:K2&quot;)) = True Then
      
      With ActiveSheet
      If .FilterMode Then
          ActiveSheet.ShowAllData
      End If
      End With
  
  Else
  
      Set rgData = ThisWorkbook.Worksheets(&quot;Pipeline&quot;).Range(&quot;A4&quot;).CurrentRegion
      Set rgCriteria = ThisWorkbook.Worksheets(&quot;Pipeline&quot;).Range(&quot;G1&quot;).CurrentRegion
  
      rgData.AdvancedFilter xlFilterInPlace, rgCriteria  
  
  End If
  
  End Sub
  </code></pre>
  <p>Am I declaring the range incorrectly?</p>