Archive of Mr Excel Message Board

Back to Data in Excel archive index
Back to archive home

Count filter results
Posted by sam on December 13, 2000 11:29 AM
I use both adv filter & autofilter but in both cases I need to miss the next part of the macro if the filter has nil returns, but I can't find a way of counting the results.
I've tried selecting them to count, but nil selects to the end of the sheet and consequently a useless value.
Can anyone suggest a method ?

Re: Count filter results
Posted by Celia on December 13, 2000 3:57 PM
:
Check whether this works :-
On Error GoTo e
x = yourFilterRange.SpecialCells(xlCellTypeVisible).Count
e: MsgBox "There are no visible cells"

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our
online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.