autofilter range count

P

pauluk

When you filter a range between to dates, does anyone know how to coun
the filtered results?

Regards
Pau
 
T

Tom Ogilvy

Actually that would be more robust if it were

Sub CountVisRows()
'by Tom Ogilvy
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range

MsgBox rng.Columns(1). _
SpecialCells(xlVisible).Count - 1 _
& " of " & rng _
.Rows.Count - 1 & " Records"

End Sub
 
D

Debra Dalgleish

Thanks Tom. I've updated the code.

Tom said:
Actually that would be more robust if it were

Sub CountVisRows()
'by Tom Ogilvy
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range

MsgBox rng.Columns(1). _
SpecialCells(xlVisible).Count - 1 _
& " of " & rng _
.Rows.Count - 1 & " Records"

End Sub
 
Top