Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilter Row Count James Excel Programming 3 December 11th 08 03:26 AM
autofilter row count Pierre[_18_] Excel Programming 3 December 21st 07 03:03 PM
AutoFilter Row Count [email protected] Excel Programming 4 August 11th 07 01:10 PM
AutoFilter and row count Bob Excel Discussion (Misc queries) 5 March 29th 07 12:40 AM
Autofilter and Cell Count asmenut Excel Programming 1 November 3rd 05 08:23 PM


All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"