'workbooks.worksheets.activate'的作品,但'.select'不 [英] 'workbooks.worksheets.activate' works, but '.select' does not
问题描述
任何人都可以告诉我为什么当我参考一个特定的表单时,我可以使用:
Could anyone tell me why, when I refer to a particular sheet, I could use:
workbooks("A").worksheets("B").activate
但不是
workbooks("A").worksheets("B").select
?
推荐答案
您无法在非活动工作簿中选择工作表。
You can't select a sheet in a non-active workbook.
您必须首先激活工作簿,然后才能选择工作表。
You must first activate the workbook, then you can select the sheet.
workbooks("A").activate
workbooks("A").worksheets("B").select
当您使用激活时,它将自动激活工作簿。
When you use Activate it automatically activates the workbook.
请注意,您可以在工作簿中选择> 1页:
Note you can select >1 sheet in a workbook:
activeworkbook.sheets(array(sheet1,sheet3))。选择
,但只有一张表可以是活动的,如果您激活不是多页选择的一部分的工作表,则其他工作表将被取消选择。
but only one sheet can be Active, and if you activate a sheet which is not part of a multi-sheet selection then those other sheets will become un-selected.
这篇关于'workbooks.worksheets.activate'的作品,但'.select'不的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!