Share via


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

  • CriteriaRange
    Type: System.Object

    Optional Object. The criteria range. If this argument is omitted, there are no criteria.

  • CopyToRange
    Type: System.Object

    Optional Object. The destination range for the copied rows if Action is xlFilterCopy. Otherwise, this argument is ignored.

  • Unique
    Type: System.Object

    Optional 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.

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace