Filter.Criteria2 property (Excel)

Returns the second filtered value for the specified column in a filtered range. Read-only Variant.

Syntax

expression.Criteria2

expression A variable that represents a Filter object.

Remarks

If you try to access the Criteria2 property for a filter that does not use two criteria, an error will occur. Check that the Operator property of the Filter object doesn't equal zero (0) before trying to access the Criteria2 property.

Example

The following example sets a variable to the value of the Criteria2 property of the filter for the first column in the filtered range on the Crew worksheet.

With Worksheets("Crew") 
 If .AutoFilterMode Then 
 With .AutoFilter.Filters(1) 
 If .On And .Operator Then 
 c2 = .Criteria2 
 Else 
 c2 = "Not set" 
 End If 
 End With 
 End If 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.