工作表代号。ComboBox1有效,但工作表(工作表编号)。不起作用。有何区别?

时间:2019-04-26 08:31:31

标签: excel vba intellisense worksheet

我正在尝试使用另一个工作表中的工作表中的ComboBox和自定义函数。

Sheet4(EDITOR)-名称为“ EDITOR”

Sheet4有一个ComboBox和一个自定义函数setupVariables()

使用Sheet4可以工作,但是任何其他引用工作表并使用其对象的方法都无法为我提供其对象或功能:

Sub test()

    Sheet4.ComboBox1 'can use objects
    Sheet4.setupVariables 'can use custom functions
    Worksheets(4). 'does NOT offer objects or custom functions
    Worksheets("EDITOR"). 'does NOT offer objects or custom functions

    Dim mySheet As Worksheet
    Set mySheet = Sheet4
    mySheet. 'does NOT offer objects or custom functions

End Sub

0 个答案:

没有答案