在Excel-VBA中,我最喜欢使用活动工作表。那么,激活VBA代码所引用的工作表是否存在任何问题,或者这是一种不好的做法?像这样:
Sub Test()
'Suppose the active sheet now is "MySheet1"
Application.ScreenUpdating = False
Worksheets("MySheet2").Activate
Cells(1,1) = "hi" 'I updated Cells(1,1) of MySheet2 and now I want to get back to MySheet1
Worksheets("MySheet1").Activate
Application.ScreenUpdating = True
End Sub