Range.AdvancedFilter Method
Filters or copies data from a list based on a criteria range.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)
Syntax
'Declaration
Function AdvancedFilter ( _
Action As XlFilterAction, _
CriteriaRange As Object, _
CopyToRange As Object, _
Unique As Object _
) As Object
'Usage
Dim instance As Range
Dim Action As XlFilterAction
Dim CriteriaRange As Object
Dim CopyToRange As Object
Dim Unique As Object
Dim returnValue As Object
returnValue = instance.AdvancedFilter(Action, _
CriteriaRange, CopyToRange, Unique)
Object AdvancedFilter(
XlFilterAction Action,
Object CriteriaRange,
Object CopyToRange,
Object Unique
)
Parameters
Action
Type: Microsoft.Office.Interop.Excel.XlFilterActionRequired XlFilterAction. Can be one of the following XlFilterAction constants:
xlFilterCopy
xlFilterInPlace
CriteriaRange
Type: System.ObjectOptional Object. The criteria range. If this argument is omitted, there are no criteria.
CopyToRange
Type: System.ObjectOptional Object. The destination range for the copied rows if Action is xlFilterCopy. Otherwise, this argument is ignored.
Unique
Type: System.ObjectOptional Object. True to filter unique records only; False to filter all records that meet the criteria. The default value is False.
Return Value
Type: System.Object
Remarks
If the initial selection is a single cell, that cell's current region is used.