Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是一个最小的例子。我只想显示特定元素为空的行。这是 Excel 宏生成器给我的。
Sub ShowEmpties() Selection.AutoFilter ActiveSheet.Range("$A$1:$M$4922").AutoFilter Field:=6, Criteria1:="=" End Sub
而不是特定于此特定工作表的 A1-M4922,无论有多少行,我如何让它过滤整个工作表?
UsedRange恢复到包含数据的工作表范围:
UsedRange
ActiveSheet.UsedRange.AutoFilter Field:=6, Criteria1:="="
ActiveSheet.Range("$A$1").CurrentRegion.AutoFilter Field:=6, Criteria1:="="