Table of contents
TOC
Collapse the table of content
Expand the table of content

Filter Function

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Description Returns a zero-based array containing subset of a string array based on a specified filter criteria. SyntaxFilter( sourcearray, match [ , include [ , compare ]] ) The Filter function syntax has thesenamed argument:

PartDescription
sourcearrayRequired. One-dimensional array of strings to be searched.
matchRequired. String to search for.
includeOptional. Boolean value indicating whether to return substrings that include or exclude match. If include is True, Filter returns the subset of the array that contains match as a substring. If include is False, Filter returns the subset of the array that does not contain match as a substring.
compareOptional. Numeric value indicating the kind of string comparison to use. See Settings section for values.

Settings The compare argument can have the following values:

ConstantValueDescription
vbUseCompareOption-1Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare0Performs a binary comparison.
vbTextCompare1Performs a textual comparison.
vbDatabaseCompare2Microsoft Access only. Performs a comparison based on information in your database.

Remarks If no matches of match are found within sourcearray, Filter returns an empty array. An error occurs if sourcearray is Null or is not a one-dimensional array. The array returned by the Filter function contains only enough elements to contain the number of matched items.

© 2017 Microsoft