|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub AutoFilter筛选法()
- Dim Arr(), endRow%, i%
- Application.DisplayAlerts = False
- With Sheet2
- endRow = .Range("A65536").End(3).Row
- Arr = Application.Transpose(Range("A1:A" & endRow))
- End With
- With Sheet1
- .Activate
- If .AutoFilterMode = True Then
- .Rows("1:1").AutoFilter
- End If
- endRow = .Range("A65536").End(3).Row
- .Rows("1:1").AutoFilter
- .Range("A1").AutoFilter Field:=1, Criteria1:=Arr, Operator:=7
- .Range("A2:C" & endRow).Delete
- .Rows("1:1").AutoFilter
- End With
- Application.DisplayAlerts = True
- End Sub
复制代码
|
|