将macros对话框留在原地
如果我想从工作表中运行一组macros,我按Alt + F8并select第一个macros:
macros运行,但对话框消失。
如果我想依次运行多个macros,我需要继续触摸Alt + F8 。
有什么办法可以configurationVBE让对话框在macros运行时保持打开?
作为一个肮脏的解决scheme,只需在macros的末尾添加SendKeys "%{f8}"
,再次调用macros窗口;)
编辑 :
现在明白了:
Application.Dialogs(xlDialogRun).Show
编辑2
你也可以创build一个带有列表框的用户窗体,其中显示了所有重要的子目录。 这样你也可以排除你不需要的潜艇,或者不想出于任何原因而出现。
你也可以通过这种方式运行subs,通常不能运行(缺less依赖/参数)。
你为什么不创build一个macros来按顺序运行其他macros呢?
Sub RunAll() ColorMeYellow FormatDownload HyperKiller NewCheck ShapeKiller SheetCounter End Sub
或者添加一个ParamArray的灵活性:
Sub RunAll(ParamArray runSequence() As Variant) For Each arg In runSequence Application.Run CStr(arg) Next End Sub
像RunAll "ColorMeYellow", "FormatDownload", "SheetCounter"