jkluio668
11/14/2017 - 1:37 AM

AutoFilter

Sub fliter1()
    r1 = 2
    Rows(r1 & ":" & r1).Select
    Selection.AutoFilter
    Selection.AutoFilter
End Sub


    Selection.AutoFilter '添加筛选区域,同时也是清除所有筛选条件
    Application.WindowState = xlNormal
    Range("$B$7:$D$10").AutoFilter Field:=1, Criteria1:="=*黑*", _
        Operator:=xlAnd  '在第一个字段(Field:=1)。包含“黑”
    Range("$B$7:$D$10").AutoFilter Field:=10, Criteria1:="=*黑*", _
        Operator:=xlOr, Criteria2:="<>*红"  '在第10个字段(Field:=10)。包含“黑”,或不包含“红”