Click to Rate and Give Feedback
MSDN
MSDN Library
Office Development
Excel 2007
Range Object
Methods
 AdvancedFilter Method

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Range.AdvancedFilter Method
Filters or copies data from a list based on a criteria range. If the initial selection is a single cell, that cell's current region is used.

Syntax

expression.AdvancedFilter(Action, CriteriaRange, CopyToRange, Unique)

expression   A variable that represents a Range object.

Parameters

NameRequired/OptionalData TypeDescription
ActionRequiredXlFilterActionOne of the constants of XlFilterAction specifying whether to make a copy or filter the list in place.
CriteriaRangeOptionalVariantThe criteria range. If this argument is omitted, there are no criteria.
CopyToRangeOptionalVariantThe destination range for the copied rows if Action is xlFilterCopy. Otherwise, this argument is ignored.
UniqueOptionalVariantTrue to filter unique records only. False to filter all records that meet the criteria. The default value is False.

Return Value
Variant

Example

This example filters a database (named "Database") based on a criteria range named "Criteria."

Visual Basic for Applications
Range("Database").AdvancedFilter _
    Action:=xlFilterInPlace, _
    CriteriaRange:=Range("Criteria")



Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker