You are on page 1of 2
ssoa017 \VBA Filler Function VBA - Filter Function https://www.tute »int.com/vba/vba_filter_function.htm Copyright © tutorialspoint.com A Filter Function, which returns a zero-based array that contains a subset of a string array based on a specific filter criteria, Syntax Filter(inputstrings, value[, include[, compare }]) Parameter Description + Inputstrings ~ A required parameter. This parameter corresponds to the array of strings to be searched. + Value ~ A required parameter. This parameter corresponds to the string to search for against the inputstrings parameter + Include ~ An optional parameter, This is a Boolean value, which indicates whether or not to return the substrings that include or exclude. + Compare ~ An optional parameti used. his parameter describes which string comparison method is to be © 0 = vbBinaryCompare - Performs a binary comparison © 1 =vbTextCompare - Performs a textual comparison Example Add a button and add the following function. Private Sub Constant_demo_Click() Dim a,b,c,d as Variant a = array("Red", "Blue", "Yellow") Filter(a, Filter(a, Filter(a, b 4 For each x in b msgbox("The Filter result Next ax) For each y inc msgoox("The Filter result 2: " & y) Next For each z ind msgbox("The Filter result 3: Next End sub ‘When you execute the above function, it produces the following output. hiipsstonywulralspeinLeonvegi-binlrinpage.ca 12 ssoa017 The The The The The hiipsstonywulralspeinLeonvegi-binlrinpage.ca Filter Filter Filter Filter Filter result 1: Blue result 2: Red result 2: Blue result 2: Yellow result 3: Yellow \VBA Filler Function

You might also like