Tuesday, March 30, 2010

How to count the number of rows in the filtered data

This Function would return the no.of rows from the Auto filter data

Function CountVisRows()
 
Dim rng As Range
Set rng = ActiveSheet.AutoFilter.Range

CountVisRows = rng.Columns(1).SpecialCells(xlCellTypeVisible).Count - 1

End Function

No comments:

Post a Comment