My Autofilter is overzealous!
You can check the count of matching rows with this function:
Function RowMatchCount(WS As Worksheet) As Long
Dim MatchCount As Long, Area As Range
For Each Area In
WS.Range("_FilterDatabase").SpecialCells(xlCellTyp eVisible).Areas
MatchCount = MatchCount + Area.Rows.Count
Next
RowMatchCount = MatchCount - 1
End Function
Sub Demo()
MsgBox RowMatchCount(Worksheets("Sheet1"))
End Sub
--
Jim Rech
Excel MVP
|