Reputation: 303
I have the following VBA code
ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=5, Criteria1:=Sheets("City").TextBox1.Text, _
Operator:=xlAnd
What I’m struggling with is how do I get the textbox (Built in the sheet not in a userform) to filter the table by greater than or equals to >=
At the moment it will only filter by equals to =
Any help will be much appreciated
Upvotes: 0
Views: 2825
Reputation: 14477
Range.AutoFilter
's Criteria1
also takes operator.
The criteria (a string; for example, "101"). Use "=" to find blank fields, or use "<>" to find nonblank fields. If this argument is omitted, the criteria is All. If Operator is xlTop10Items, Criteria1 specifies the number of items (for example, "10").
So you can just enter 5
or >=5
in the TextBox1
Upvotes: 1