Excel、VBA 编辑器 - Worksheet 对象属性的自动完成功能不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15469630/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-11 20:05:36  来源:igfitidea点击:

Excel, VBA Editor - Autocomplete for the Worksheet object's properties doesn't work

excel-vbaautocompleteexcel-2007vbaexcel

提问by colemik

I want the VBA Editor to use the Autocomplete feature to display the properties of the Worksheet object.

我希望 VBA 编辑器使用自动完成功能来显示 Worksheet 对象的属性。

enter image description here

在此处输入图片说明



Out of thisquestion on SuperUser, I've learned that the Worksheetsobject Item()property returns the Variant type. That type is not strongly typed to the Worksheetobject.

从SuperUser 上的这个问题中,我了解到WorksheetsobjectItem()属性返回 Variant 类型。该类型不是Worksheet对象的强类型。

But, even if I use the ActiveSheetobject or the following code, the IDE still does not display the properties of the Worksheetobject.

但是,即使我使用ActiveSheet对象或以下代码,IDE 仍然不显示Worksheet对象的属性。

enter image description here

在此处输入图片说明

My question is, how to make the VBA Editor in Excel to display the properties of the Worksheet object through the Autocomplete feature?

我的问题是,如何让Excel中的VBA编辑器通过自动完成功能显示Worksheet对象的属性?

回答by

Kindly declare mySheet variable as worksheet to get autocompletion.Please refer to the below image.

请将 mySheet 变量声明为工作表以获取自动完成功能。请参考下图。

enter image description here

在此处输入图片说明