I am trying to write a function to return the next visible row in an autofiltered list.
In a sheet with an autofiltered range the code below returns a #VALUE error:
Tthe following should accomplish what you are looking for.
Public Function NextVisibleCell(Range As Range) As Range
Application.Volatile
Dim i As Long
Set Range = Range.Cells(Range.Rows.Count, Range.Columns.Count)
For i = 1 To Rows.Count - Range.Row
If Not Range.Offset(i).EntireRow.Hidden Then
Set NextVisibleCell = Range.Offset(i)
Exit Function
End If
Next i
End Function