Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Counting rows in AutoFilter mode

I just want to count the number of records/rows who match a value
specified with AutoFilter.

I already tried this:

Selection.AutoFilter Field:=3, Criteria1:="TEST"
Range("c1").Select
Range(Selection, Selection.End(xlDown)).Select
intTest = Selection.Rows.Count

but this wil give te wrong result.

please, can anyone give me an answer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Counting rows in AutoFilter mode

Try this.
Selection.AutoFilter Field:=3, Criteria1:="TEST"
MsgBox selection.SpecialCells(xlCellTypeVisible).Count

"Rob Pauly" wrote in message
m...
I just want to count the number of records/rows who match a value
specified with AutoFilter.

I already tried this:

Selection.AutoFilter Field:=3, Criteria1:="TEST"
Range("c1").Select
Range(Selection, Selection.End(xlDown)).Select
intTest = Selection.Rows.Count

but this wil give te wrong result.

please, can anyone give me an answer



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Counting rows in AutoFilter mode

This only works if you restrict the selection to one column

Activesheet.Autofilter.Range.Columns(1).SpecialCel ls(xlVisible).count -1

subtract 1 to remove the count of the header row.

--
Regards,
Tom Ogilvy


"Don Guillett" wrote in message
...
Try this.
Selection.AutoFilter Field:=3, Criteria1:="TEST"
MsgBox selection.SpecialCells(xlCellTypeVisible).Count

"Rob Pauly" wrote in message
m...
I just want to count the number of records/rows who match a value
specified with AutoFilter.

I already tried this:

Selection.AutoFilter Field:=3, Criteria1:="TEST"
Range("c1").Select
Range(Selection, Selection.End(xlDown)).Select
intTest = Selection.Rows.Count

but this wil give te wrong result.

please, can anyone give me an answer





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
Counting Filtered Results Using Autofilter jj Excel Worksheet Functions 2 April 2nd 10 12:18 AM
delete only visible rows in filter mode ajezmohd Excel Discussion (Misc queries) 4 September 29th 09 07:04 PM
Deleting rows in filter mode - Excel 2007 Michael New Users to Excel 0 April 17th 08 10:56 PM
Counting the no. of entries after applying autofilter 1max Excel Discussion (Misc queries) 2 June 22nd 06 06:30 AM
Autofilter counting sorted items leo Excel Discussion (Misc queries) 2 February 6th 06 01:25 PM


All times are GMT +1. The time now is 02:30 PM.

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

About Us

"It's about Microsoft Excel"