I'm filtering a spreadsheet that is providing results. For some reason, it's following the error protocol I have built-in rather than doing what is expected.
Sheets("Sheet1").Range("B4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.AutoFilter Field:=14, Criteria1:="DED*", Operator:=xlOr, Criteria2:="DEX*"
On Error GoTo Errline1
Dim Count1 As Range
Set Count1 = Range(Selection, Selection.SpecialCells(xlCellTypeLastCell))
Dim Line As Range
For Each Line In Count1.SpecialCells(xlCellTypeVisible).Areas
Count1 = Count1 + Line.Rows.Count
Next Line
I'm expecting this to set Count1 as the number of rows that are visible so I can then use that number as part of an if statement further down. However, once it gets to the "Next Line" portion, it errors and goes to Errline1