Click to Rate and Give Feedback
MSDN
MSDN Library
Office Development
Office 2003
Range Interface
Range Methods
 AdvancedFilter Method
Collapse All/Expand All Collapse All
Other versions are also available for the following:
Excel Primary Interop Assembly Reference 
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)

Visual Basic
Dim <span id="parameterToolTip" class="tip" tabindex="0">Action</span> As XlFilterAction
Dim <span id="parameterToolTip" class="tip" tabindex="0">CriteriaRange</span> As Object
Dim <span id="parameterToolTip" class="tip" tabindex="0">CopyToRange</span> As Object
Dim <span id="parameterToolTip" class="tip" tabindex="0">Unique</span> As Object
Dim returnValue As Object
Dim range1 As Range
returnValue = range1.AdvancedFilter(<span id="parameterToolTip" class="tip" tabindex="0">Action</span>, <span id="parameterToolTip" class="tip" tabindex="0">CriteriaRange</span>, <span id="parameterToolTip" class="tip" tabindex="0">CopyToRange</span>, <span id="parameterToolTip" class="tip" tabindex="0">Unique</span>)
Visual Basic
Function AdvancedFilter( _
	<InAttribute()> ByVal Action As XlFilterAction, _
	<InAttribute()> Optional ByVal CriteriaRange As Object, _
	<InAttribute()> Optional ByVal CopyToRange As Object, _
	<InAttribute()> Optional ByVal Unique As Object _
) As Object
C#
object AdvancedFilter(
	[In] XlFilterAction Action, 
	[In, Optional] object CriteriaRange, 
	[In, Optional] object CopyToRange, 
	[In, Optional] object Unique
);
C++
public: Object^ AdvancedFilter(
	XlFilterAction^ Action, 
	Object^ CriteriaRange, 
	Object^ CopyToRange, 
	Object^ Unique
);
J#
public System.Object AdvancedFilter(
	/*in*/XlFilterAction Action, 
	/*in*/System.Object CriteriaRange, 
	/*in*/System.Object CopyToRange, 
	/*in*/System.Object Unique
);
JScript
function AdvancedFilter(
	 Action : XlFilterAction, 
	 CriteriaRange : Object, 
	 CopyToRange : Object, 
	 Unique : Object
) : Object;

Parameters

Action

Required XlFilterAction. Can be one of the following XlFilterAction constants:

  • xlFilterCopy

  • xlFilterInPlace

CriteriaRange

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

CopyToRange

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

Unique

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

If the initial selection is a single cell, that cell's current region is used.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

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