VBA expand/collapse rows with same macro button
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We have a trivial problem regarding how to run a simple macro button. The purpose of this button is two-fold: expanding a row and collapsing a row. 1 on pressing the button this VBA command is initiated: Sub Macro7() Rows(7).ShowDetail = True End Sub This command expands row 7. 2 on pressing the button again (whilst the row is expanded), this VBA is initiated: Sub Macro7() Rows(7).ShowDetail = False End Sub This collapses the row. Is there a way to link a button to two macros? Thanks in advance!!! M 回答1: Sub Macro7() With Rows(7) .ShowDetail