Tag: code hinting

如何在Worksheet代码中声明和使用公用函数和子例程

我在我的工作表模块中声明了一个公共函数: Public Function isValidContract(contract As String) As Boolean ' Code reads cell values from the worksheet and determines ' if passed-in contract is one of them. End Function 我想能够从其他模块和类模块访问它。 我已经尝试了以下内容: Public Sub someRandomSubInAntoherModule() Dim contract As String Dim sh as Worksheet ' Code that sets contract Set sh = Sheets("Matrix") If Not sh.isValidContract(contract) Then ' […]