Click to Rate and Give Feedback
MSDN
MSDN Library
Office Development
Office 2003
Reference
Methods
A
 AdvancedFilter Method [Excel 2003 V...
Collapse All/Expand All Collapse All
Office Excel 2003 VBA Language Reference
AdvancedFilter Method [Excel 2003 VBA Language Reference]

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

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

expression Required. An expression that returns one of the objects in the Applies To list.

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

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

Unique   Optional Variant. True to filter unique records only. False to filter all records that meet the criteria. The default value is False.

Example

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

Range("Database").AdvancedFilter _
    Action:=xlFilterInPlace, _
    CriteriaRange:=Range("Criteria")
		


Applies to | Range Collection

See Also | AutoFilter Method | FilterMode Property | ShowAllData Method


© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker