I've been having some issues trying to clear a filter that I installed.
It's purpous is to show all the data inside the data base if a certain range of cells are empty.
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
Dim rgData As Range, rgCriteria As Range
Worksheets("Pipeline").Activate
If IsEmpty(Range("G2:K2")) = True Then
With ActiveSheet
If .FilterMode Then
ActiveSheet.ShowAllData
End If
End With
Else
Set rgData = ThisWorkbook.Worksheets("Pipeline").Range("A4").CurrentRegion
Set rgCriteria = ThisWorkbook.Worksheets("Pipeline").Range("G1").CurrentRegion
rgData.AdvancedFilter xlFilterInPlace, rgCriteria
End If
End Sub
Am I declaring the range incorrectly?