Excel VBA高级筛选,通过动态修改查询条件进行筛选(CriteriaRange 条件),将筛选结果写入指定单元格(A7)。
Sub 宏1()
'
' 宏1 宏
'
'
Range("A7:G10000").Clear
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
Sheets("工单录入").Columns("A:L").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("vba!Criteria"), CopyToRange:=Range("A7"), Unique:= _
False
Range("B7:F10000").Select
Selection.Delete Shift:=xlToLeft
End Sub