首页 > 解决方案 > 使用 VBA 折叠组的更有效方法

问题描述

我有一个 8000 行的电子表格,我们利用分组来组织它。我在工作表上有一些带有宏的按钮,以帮助扩展和折叠组。该代码有效,但是速度很慢。

       With sht.Outline
            .ShowLevels RowLevels:=6
            .ShowLevels RowLevels:=5
            .ShowLevels RowLevels:=4
            .ShowLevels RowLevels:=3
            .ShowLevels RowLevels:=2
            .ShowLevels RowLevels:=1
        End With

注意:在此过程中我确实Application.ScreenUpdating关闭了。

有没有比我现在做的更有效的方法来折叠或展开行?

标签: vbaexcelperformancegrouping

解决方案


推荐阅读