作者chris75123 (123)
看板Visual_Basic
标题[VBA ] AutoFilter筛选多个值
时间Thu Jul 9 18:52:41 2015
各位大大好,
小弟最近刚学用VBA,
遇到一个问题想要请问:
想要筛选出非ant开头、非balloon开头、不包含cat字眼的值,
但是遇到以下问题,求解~
=============================================================================
1.
ActiveSheet.Range("$B$5:$K$20000").AutoFilter Field:=2, Criteria1:=Array( _
"<>ant*", "<>balloon*", "<>*cat*"), Operator:=xlAnd
=> 只会筛选不包含cat字眼的值
=============================================================================
2.
ActiveSheet.Range("$B$5:$K$20000").AutoFilter Field:=2, Criteria1:=Array( _
"<>ant*", "<>balloon*", "*cat*"), Operator:=xlFilterValues
=> Class Range的AutoFilter 方法失败
=============================================================================
3.
ActiveSheet.Range("$B$5:$K$20000").AutoFilter Field:=2, Criteria1:= _
"<>ant*", Operator:=xlAnd, Criteria2:= "<>balloon*"
=> 只能筛选两个值
=============================================================================
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 223.137.190.243
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Visual_Basic/M.1436439163.A.A76.html
1F:推 johnpage: 筛完後再筛 07/09 19:53
2F:→ chris75123: 请问要如何筛完再筛? 筛第二次就会只套用第二次的结果 07/14 14:55