Range.AdvancedFilter (Excel)

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.

AdvancedFilter (Action, CriteriaRange, CopyToRange, Unique)


ActiveCell.AdvancedFilter Action:=xlFilterCopy

Arguments

The following argument is required

Action (XlFilterAction) - One of the constants of XlFilterAction specifying whether to make a copy or filter the list in place.

Possible return values are xlFilterCopy - Copy filtered data to new location, xlFilterInPlace - Leave data in place.

Optional arguments

The following arguments are optional

CriteriaRange (Range) - The criteria range. If this argument is omitted, there are no criteria.

CopyToRange (Range) - The destination range for the copied rows if Action is xlFilterCopy. Otherwise, this argument is ignored.

Unique (Boolean) - True to filter unique records only. False to filter all records that meet the criteria. The default value is False.