您可以取消隐藏他们绕过任何限制的隐藏工作表没有用户意识到它,做你需要的任何东西,然后再把它们隐藏起来。
此示例假定Sheet2处于隐藏状态。
Sub DoStuffToAHiddenSheetWithoutTheUserKnowingIt()
'turns off screen repainting so the user can't see what you're doing
'incidentally, this dramatically speeds up processing of your code
Application.ScreenUpdating = False
'note that if you're stepping through your code, screenupdating will be true anyway
'unhide the sheet you want to work with
Sheets("sheet2").Visible = True
'do whatever you want here, including selecting cells if you want
'Scagnelli is right though, only select cells if you have to
'when you're finished, hide the sheet again
Sheets("sheet2").Visible = False
'make sure you turn screenupdating back on, or Excel will be useless
Application.ScreenUpdating = True
End Sub
,如果你想你的床单隐藏的另一个有用的技巧是将它们设置为xlVeryHidden,这将防止它们被列在用户如果他们试图通过菜单或功能区取消隐藏它们。
您可以详细说明如何打开工作簿并使其不可见吗? – 2009-05-21 16:48:57