取消Excel VBA中的筛选。

huangapple go评论200阅读模式
英文:

Uncheck filter in excel VBA

问题

ActiveSheet.Range("&A$12:$AM$31570").AutoFilter Field:=16, Criteria1:=Array("0", "1", "2", "3", "4"), Operator:=xlFilterValues

英文:

I am working on creating a filter macro in excel. I need to filter out (uncheck) few of the items for example value 10 or 11 needs to be excluded and rest of the values are fine. We have an unknown amount of values in the column. only values needs to be excluded are 10 and 11. Any help is appreciated.

ActiveSheet.Range("$A$12:$AM$31570").AutoFilter Field:=16, Criteria1:=Array("0", "1", "2", "3", "4"), Operator:=xlFilterValues

答案1

得分: 1

你可以这样做,如果要从筛选中排除值10和11:

ActiveSheet.Range("$A$12:$AM$31570").AutoFilter Field:=16, Criteria1:="<>10", Operator:=xlAnd, Criteria2:="<>11"
英文:

You could do the following if you want to exclude values 10 and 11 from your filter:

ActiveSheet.Range(&quot;$A$12:$AM$31570&quot;).AutoFilter Field:=16, Criteria1:=&quot;&lt;&gt;10&quot;, Operator:=xlAnd, Criteria2:=&quot;&lt;&gt;11&quot;

huangapple
  • 本文由 发表于 2023年3月21日 02:56:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/75794248.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定