Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the count from autofilter
I recorded a macro to use autofilter. I do not know how to access the count
of the result after filtering on a column. Let's say I have 10 rows and after I filter only 2 rows show up. I want to access the result that gives me 2. I think this is count but wha tis the code to get it. Thanks -- Jason V |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the count from autofilter
Hi Jason
Something like this after the code that do the filter With ActiveSheet.AutoFilter.Range.Columns(1) On Error Resume Next Set rng = .SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then MsgBox rng.Cells.Count - 1 End With -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Jason V" wrote in message ... I recorded a macro to use autofilter. I do not know how to access the count of the result after filtering on a column. Let's say I have 10 rows and after I filter only 2 rows show up. I want to access the result that gives me 2. I think this is count but wha tis the code to get it. Thanks -- Jason V |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Getting the count from autofilter
Thank you. Exactly what I wanted.
-- Jason V "Ron de Bruin" wrote: Hi Jason Something like this after the code that do the filter With ActiveSheet.AutoFilter.Range.Columns(1) On Error Resume Next Set rng = .SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then MsgBox rng.Cells.Count - 1 End With -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Jason V" wrote in message ... I recorded a macro to use autofilter. I do not know how to access the count of the result after filtering on a column. Let's say I have 10 rows and after I filter only 2 rows show up. I want to access the result that gives me 2. I think this is count but wha tis the code to get it. Thanks -- Jason V |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofilter Row Count | Excel Programming | |||
autofilter row count | Excel Programming | |||
AutoFilter Row Count | Excel Programming | |||
AutoFilter and row count | Excel Discussion (Misc queries) | |||
Autofilter and Cell Count | Excel Programming |