Jump to content

Filter particular and take count of rows in that filter and remove filter later


Recommended Posts

Hi, 

i have an excel with data from A to MX.

I have to apply filter for all rows and filter N to specific term say "Yes" and take count of number of rows in that filter.
Later i have to remove that filter.

I am not sure where to add that "Yes" term in Excel_FilterSet ( $oWorkbook, $vWorksheet, $vRange, $iField [, $sCriteria1 = Default [, $iOperator = Default [, $sCriteria2 = Default]]] )

Any suggestions and ideas??

Link to comment
Share on other sites

I am not sure you are taking the right path if you intend just to get a count.  Filter is used normally to show a different view of the data, not to simplify count or other math operations.  Since we do not know exactly what you want to achieve, I would suggest this :

Local $aSelect = _Excel_RangeFind ($oWorkbook, "Yes", "I1:I99")
_ArrayDisplay ($aSelect)

 

Link to comment
Share on other sites

Hi ,

i have tried this,

$oRange = $oExcel.ActiveSheet.Range("A:A")
MsgBox(4096, "Excel Count Non-Blank Cells", $oExcel.WorksheetFunction.CountA($oRange))

Now i am getting total count of columns..but not filtered ones..

Will any edit in this help?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...