按大于或等于 (>=) 筛选 table

filter table by greater than or equals to (>=)

我有以下VBA代码

ActiveSheet.ListObjects("Table1").Range.AutoFilter Field:=5, Criteria1:=Sheets("City").TextBox1.Text, _
Operator:=xlAnd

我正在努力解决的问题是如何获取文本框(内置于 sheet 而不是用户表单中)来过滤 table 大于或等于 >=

目前它只会过滤等于 =

任何帮助将不胜感激

Range.AutoFilterCriteria1 也需要运算符。

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").

Range.AutoFilter Method (Excel)

因此您只需在 TextBox1

中输入 5>=5