我不知道你为什么需要这样的东西。
但这是可能的
! 了解应用程序调用方-它是运行UDF的rng。
Private Function myFuncCalc(ByVal xstr As String)
' it is your main function to calculate what you want
' just sample code to test below
If xstr = "USD" Then
myFuncCalc = "yes it's american dollar!"
Else
myFuncCalc = "it's no american dollar"
End If
End Function
Function myFunc(a)
' function just to be available in worksheet
' and extracting currency letter codes from formula between brackets
bra1 = InStr(Application.Caller.Formula, "(")
bra2 = InStr(Application.Caller.Formula, ")")
x = Mid(Application.Caller.Formula, bra1 + 1, bra2 - bra1 - 1)
myFunc = myFuncCalc(x)
End Function
瞧!