Solved Hiding rows that do not meet criteria

November 2, 2016 at 09:15:53
Specs: Windows 7
Hello community, reaching out for a tweak to my code below. I am trying to cleanup the view once the criteria is executed. I would like to hide rows that do not meet the criteria to not have to see a bunch of blank rows after criteria is filtered.

Sub PipelineShowAPPROVEDLoans()
If (ActiveSheet.AutoFilterMode And ActiveSheet.FilterMode) Or ActiveSheet.FilterMode Then
  ActiveSheet.ShowAllData
End If
    ActiveSheet.Range("$a$6:$ET$1000").AutoFilter Field:=34, Criteria1:="<>Pre-Approval"
    ActiveSheet.Range("$A$6:$ET$1000").AutoFilter Field:=7, Criteria1:="APPR"
    ActiveWindow.SmallScroll Down:=-15
    ActiveSheet.Range("$A$6:$ET$1000").AutoFilter Field:=6, Criteria1:="<>"
End Sub


See More: Hiding rows that do not meet criteria

Report •

#1
November 4, 2016 at 15:13:10
✔ Best Answer
In case someone else needs this, I was able to get the problem solved with this code:

Dim r As Range
Set r = ActiveSheet.UsedRange
   ActiveSheet.Range("$a$6:$ET$1000").AutoFilter Field:=34, Criteria1:="<>Pre-Approval"
    ActiveSheet.Range("$A$6:$ET$1000").AutoFilter Field:=7, Criteria1:="APPR"
    ActiveSheet.Range("$A$6:$ET$1000").AutoFilter Field:=6, Criteria1:="<>"
    Range(Cells(r.Rows.Count + 1, 1), Cells(Rows.Count, Columns.Count)).EntireRow.Hidden = True
 


Report •
Related Solutions


Ask Question