I want to be able to find the row number of the first blank row under a filtered table. I was using this code, but it finds the final line of the filtered table.
.Range("A1").End(xlDown).Row
I want to be able to find the row number of the first blank row under a filtered table. I was using this code, but it finds the final line of the filtered table.
.Range("A1").End(xlDown).Row
Here you go:
Dim HeaderRow As Long, LastFilterRow As Long, Addresses() As String
On Error GoTo NoFilterOnSheet
With ActiveSheet
HeaderRow = .AutoFilter.Range(1).Row
LastFilterRow = .Range(Split(.AutoFilter.Range.Address, ":")(1)).Row
Addresses = Split(.Range((HeaderRow + 1) & ":" & LastFilterRow). _
SpecialCells(xlCellTypeVisible).Address, "$")
GetFilteredRangeBottomRow = Addresses(UBound(Addresses))
FirstBlankRow = GetFilteredRangeBottomRow + 1
MsgBox FirstBlankRow
End With
NoFilterOnSheet: