The one thing I've found that makes my VBA programming easier is to always fully specify the object you're trying to manipulate (well, except maybe the top-level Application).
That means you should use something like Workbooks(0).Worksheets("Sheet1").main instead of relying on the active workbook.
发布评论
评论(1)
我发现使我的 VBA 编程变得更容易的一件事是始终完全指定您要操作的对象(嗯,除了顶级
Application
)。这意味着您应该使用类似
Workbooks(0).Worksheets("Sheet1").main
的内容,而不是依赖活动工作簿。The one thing I've found that makes my VBA programming easier is to always fully specify the object you're trying to manipulate (well, except maybe the top-level
Application
).That means you should use something like
Workbooks(0).Worksheets("Sheet1").main
instead of relying on the active workbook.