|

楼主 |
发表于 2023-7-7 11:41
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
[a3:ae3].Clear
If [c4] <> "" Then [aa3] = ">=" & [c4]
If [c5] <> "" Then [ab3] = "<=" & [c5]
If [p4] <> "" Then [ad3] = ">=" & [p4]
If [p5] <> "" Then [ae3] = "<=" & [p5]
If [e4] <> "" Then [f3] = [e4]
If [e5] <> "" Then [c3] = [e5]
If [g4] <> "" Then [d3] = [g4]
If [g5] <> "" Then [e3] = [g5]
x = Sheet1.Range("b65536").End(xlUp).Row '最后行数
If [c4] <> "" And [c5] <> "" Then
Sheet1.Range("b4:u" & x).AdvancedFilter 2, [aa2:ab3], [b7:u7] '高级筛选最简代码
Else
Sheet1.Range("b4:u" & x).AdvancedFilter 2, [ad2:ae3], [b7:u7] '高级筛选最简代码
End If
|
|