Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Counting Filtered Results Using Autofilter | Excel Worksheet Functions | |||
delete only visible rows in filter mode | Excel Discussion (Misc queries) | |||
Deleting rows in filter mode - Excel 2007 | New Users to Excel | |||
Counting the no. of entries after applying autofilter | Excel Discussion (Misc queries) | |||
Autofilter counting sorted items | Excel Discussion (Misc queries) |