[英]User-defined Function in VBA Excel is Not Accessible?
I have this function in a module in my VBE, but when I try to access it in my userforms, I get an error because it cannot be detected by VBE: 我在我的VBE中的模块中有这个功能,但是当我尝试在我的用户表单中访问它时,我收到一个错误,因为VBE无法检测到它:
This is the Col_Letter
function: 这是Col_Letter
函数:
Function Col_Letter(lngCol As Long) As String
Dim vArr
vArr = Split(Cells(1, lngCol).Address(True, False), "$")
Col_Letter = vArr(0)
End Function
I also tried adding Public
: 我也尝试过添加Public
:
Public Function Col_Letter(lngCol As Long) As String
Dim vArr
vArr = Split(Cells(1, lngCol).Address(True, False), "$")
Col_Letter = vArr(0)
End Function
Naming a module with the same name as a public funciton is quite a bad idea. 命名一个与公共函数同名的模块是一个非常糟糕的主意。 Change the name of the Col_Letter
module or the name of the function. 更改Col_Letter
模块的名称或函数的名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.