它看起来像这样
Function COL()
COL = WorksheetFunction.Column()
End Function
Application.Caller将为您提供对单元格的引用,您可以从中获取列。例如
Public Function COL()
Select Case TypeName(Application.Caller)
Case "Range"
COL = Application.Caller.Column
Case Else
COL = "unknown"
End Select
End Function