【问题标题】:Use autofilter on more than 2 criteria with logic operators使用逻辑运算符对超过 2 个条件使用自动过滤器
【发布时间】:2019-08-17 20:38:04
【问题描述】:

我已经尝试过了,但我的代码返回运行时错误 1004。Use autofilter on more than 2 criteria

逻辑运算符是否与此有关?

.AutoFilter Field:=1, Criteria1:=Array("<>*string1*", "<>*string2*", "<>*string3*"), Operator:=xlFilterValues

【问题讨论】:

  • .AutoFilter 在使用通配符时最多限制为 2 个条件 - 我在这个问题 here 上写了一个解决这个问题的方法。您必须使用通配符标准构建一个数组,然后对其进行过滤。

标签: excel vba autofilter


【解决方案1】:

您不能只创建一个过滤器列并在其中放入一个 if 语句吗?类似于下面的公式,然后只过滤该列

=IFERROR(FIND("string1",UPPER(C9)),0)+IFERROR(FIND("string2",UPPER(C9)),0)+IFERROR(FIND("string2",UPPER(C9)),0)

【讨论】:

    猜你喜欢
    • 2014-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多