Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Sub test()
MsgBox "First visible row = " & FirstVisibleRow(Range("A1:X1000"))
End Sub
Function FirstVisibleRow(AutoFilterTable As Range) As Long
Dim rng As Range
Dim nFirstRow As Long
Dim nLastRow As Long
' Find first and last rows of table
With AutoFilterTable
nFirstRow = .Row + 1
nLastRow = .Rows.Count + .Row - 1
' Find first visible row within auto filter table
Set rng = Intersect(.SpecialCells(xlCellTypeVisible), _
Range(nFirstRow & ":" & nLastRow))
FirstVisibleRow = rng.Row
Set rng = Nothing
End With
End Function
With Range("FILTERDATA")
nRow = Intersect(.Columns(1), .SpecialCells(xlCellTypeVisible)).Row
End With