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
Excel, VBA Editor - Autocomplete for the Worksheet object's properties doesn't work
提问by colemik
I want the VBA Editor to use the Autocomplete feature to display the properties of the Worksheet object.
我希望 VBA 编辑器使用自动完成功能来显示 Worksheet 对象的属性。
Out of thisquestion on SuperUser, I've learned that the Worksheets
object Item()
property returns the Variant type. That type is not strongly typed to the Worksheet
object.
从SuperUser 上的这个问题中,我了解到Worksheets
objectItem()
属性返回 Variant 类型。该类型不是Worksheet
对象的强类型。
But, even if I use the ActiveSheet
object or the following code, the IDE still does not display the properties of the Worksheet
object.
但是,即使我使用ActiveSheet
对象或以下代码,IDE 仍然不显示Worksheet
对象的属性。
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 变量声明为工作表以获取自动完成功能。请参考下图。