Sub VisibleRowsInSelection()
Dim rng As Range
Dim c As Range
Dim rowCount As Long
Dim uniqueRows As Collection
Set uniqueRows = New Collection
On Error Resume Next
For Each c In Selection.SpecialCells(xlCellTypeVisible)
uniqueRows.Add c.Row, CStr(c.Row)
Next c
On Error GoTo 0
rowCount = uniqueRows.Count
MsgBox "Number of visible rows: " & rowCount
End Sub
Good morning and thank you for your reply, unfortunately this is not quite what i am after. As per the image attached, when i filter my sheet and i am left with the result, i would like to count the lines and display it in Range("G2").value every time the reset my sheetSub VisibleRowsInSelection() Dim rng As Range Dim c As Range Dim rowCount As Long Dim uniqueRows As Collection Set uniqueRows = New Collection On Error Resume Next For Each c In Selection.SpecialCells(xlCellTypeVisible) uniqueRows.Add c.Row, CStr(c.Row) Next c On Error GoTo 0 rowCount = uniqueRows.Count MsgBox "Number of visible rows: " & rowCount End Sub