Difference between revisions of "Excel Filter"

From AutoIt Wiki
Jump to navigation Jump to search
m (Set filer)
m
Line 1: Line 1:
 +
{{WIP}}
 
== Set filter ==
 
== Set filter ==
 
...
 
...

Revision as of 17:23, 3 December 2015

This page is still a work in progress.

Set filter

...

Retrieve all filtered rows

To retrieve all rows of a filtered range you need to work with Areas. An Area consists of one or multiple Ranges which you need to process in a loop. The following example returns an array with all visible rows.

$oRange = $oWorkbook.ActiveSheet.Usedrange.SpecialCells($xlCellTypeVisible)
Local $aResult[1][$oRange.columns.Count], $aContent
; Read the data of all Ranges in the Area and concatenate the returned arrays.
For $oArea In $oRange.Areas
    $aContent = _Excel_RangeRead($oWorkbook, Default, $oArea, Default, True)
    _ArrayConcatenate($aResult, $aContent)
Next