ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Count of results in AutoFilter (https://www.excelbanter.com/excel-programming/311387-count-results-autofilter.html)

andrew

Count of results in AutoFilter
 
Hello all,

I have an autofilter running through a macro - but I would
like to retrieve the number of rows that met the filter
criteria.

Is there a .count property (or something similar) on the
AutoFilter object? If not, is there a countif(visible)
formula I could use directly in the worksheet?

Thanks!!!!

Tom Ogilvy

Count of results in AutoFilter
 
set rng = Activesheet.autofilter.Range.Columns(1)
set rng1 = rng.SpecialCells(xlVisible)
msgbox rng1.Count - 1 ' subtract the header

--
Regards,
Tom Ogilvy

"andrew" wrote in message
...
Hello all,

I have an autofilter running through a macro - but I would
like to retrieve the number of rows that met the filter
criteria.

Is there a .count property (or something similar) on the
AutoFilter object? If not, is there a countif(visible)
formula I could use directly in the worksheet?

Thanks!!!!




No Name

Count of results in AutoFilter
 
Perfect.

Thanks!

-----Original Message-----
set rng = Activesheet.autofilter.Range.Columns(1)
set rng1 = rng.SpecialCells(xlVisible)
msgbox rng1.Count - 1 ' subtract the header

--
Regards,
Tom Ogilvy

"andrew" wrote in

message
...
Hello all,

I have an autofilter running through a macro - but I

would
like to retrieve the number of rows that met the filter
criteria.

Is there a .count property (or something similar) on the
AutoFilter object? If not, is there a countif(visible)
formula I could use directly in the worksheet?

Thanks!!!!



.


Steve Smallman

Count of results in AutoFilter
 
in the worksheet, use the subtotal function with function 2 for numeric and
3 for alpha data.

In a list of alpha data, add beneath the list the function
=SUBTOTAL(3,range)

Steve
"andrew" wrote in message
...
Hello all,

I have an autofilter running through a macro - but I would
like to retrieve the number of rows that met the filter
criteria.

Is there a .count property (or something similar) on the
AutoFilter object? If not, is there a countif(visible)
formula I could use directly in the worksheet?

Thanks!!!!





All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com