我有一个大表,我在excel的名称管理器中定义为"WW60_STRI“
我正在尝试编写一个函数,该函数返回表第1列中的最大值。在正确的语法下面使用,因为我得到了#值!在单元格中键入=wlookup(WW60_STRI,“max纵深”)时的结果
Public Function wlookup(Name As String, Retrieve As String)
Set WW60_STRI = Range("WW60_STRI")
Select Case Name
Case WW60_STRI:
Select Case Retrieve
Case "maxdepth"
wlookup = Application.WorksheetFunction.Max(WW60_STRI.Columns(1))
End Select
Case Else
wlookup = "error"
End Select
End Function谢谢!
发布于 2022-08-16 23:25:50
WW60_STRI需要用引号括起来。
Public Function wlookup(Name As String, Retrieve As String)
Set WW60_STRI = Range("WW60_STRI")
Select Case Name
Case "WW60_STRI":
Select Case Retrieve
Case "maxdepth"
wlookup = Application.WorksheetFunction.Max(WW60_STRI.Columns(1))
End Select
Case Else
wlookup = "error"
End Select
End Functionhttps://stackoverflow.com/questions/73381280
复制相似问题