在Excel文本函数中使用Application.Caller(text.BetweenDelimiters)

在Excel文本函数中使用Application.Caller(text.BetweenDelimiters),excel,vba,Excel,Vba,我正在Excel工作表中使用一个编程制作的VBA按钮,并使用Application.Caller作为一种方式,通过此按钮将一些参数发送到子调用。现在,我正试图提取这些参数,多亏了这个Sub 这是我的测试(工作非常完美&字符串实际上与Application.Caller内容相同): 这里是实际代码(无效过程调用或参数): 所以我所需要的就是找到一种将Application.caller用作字符串的方法。 有什么帮助吗?Damnnn没错。。。我两个都用,所以我没犯什么错误,谢谢。我将编辑我的帖子,因

我正在Excel工作表中使用一个编程制作的VBA按钮,并使用Application.Caller作为一种方式,通过此按钮将一些参数发送到子调用。现在,我正试图提取这些参数,多亏了这个Sub

这是我的测试(工作非常完美&字符串实际上与Application.Caller内容相同):

这里是实际代码(无效过程调用或参数):

所以我所需要的就是找到一种将Application.caller用作字符串的方法。
有什么帮助吗?

Damnnn没错。。。我两个都用,所以我没犯什么错误,谢谢。我将编辑我的帖子,因为在更正后我仍然被事件卡住,可能
ActiveSheet.Buttons(Application.Caller).Caption
Application.Caller
将是
Shape
类型的对象(例如,具体取决于“VBA按钮”是什么),正如@BigBen所指出的,你需要从这个想法开始。你在创造什么类型的“按钮”?ActiveX还是表单?一切都很好,感谢@BigBen,答案是使用ActiveSheet.Buttons(Application.Caller)。名称而不是ActiveSheet.Buttons(Application.Caller)。标题
Public Sub DB_Export_Click() ' assign an action to the DB button
Dim ke, Li, item1, item2 As Integer

item1 = InStr("Export (23-25)", "(") ' position of start delimiter
item2 = InStr("Export (23-25)", "-") ' position of end delimiter
ke = CInt(Mid("Export (23-25)", item1 + 1, item2 - item1 - 1)) ' extract the string between two delimiters and convert it to integer
MsgBox (ke)

item1 = InStr("Export (23-25)", "-") ' position of start delimiter
item2 = InStr("Export (23-25)", ")") ' position of end delimiter
Li = CInt(Mid("Export (23-25)", item1 + 1, item2 - item1 - 1)) ' extract the string between two delimiters and convert it to integer
MsgBox (Li)
Public Sub DB_Export_Click() ' assign an action to the DB button
Dim ke, Li, item1, item2 As Integer

item1 = InStr(CStr(Application.Caller), "(") ' position of start delimiter
item2 = InStr(CStr(Application.Caller), "-") ' position of end delimiter
ke = CInt(Mid(CStr(Application.Caller), item1 + 1, item2 - item1 - 1)) ' extract the string between two delimiters and convert it to integer
MsgBox (ke)

item1 = InStr(CStr(Application.Caller), "-") ' position of start delimiter
item2 = InStr(CStr(Application.Caller), ")") ' position of end delimiter
Li = CInt(Mid(CStr(Application.Caller), item1 + 1, item2 - item1 - 1)) ' extract the string between two delimiters and convert it to integer
MsgBox (Li)

'Re_Edit_Form K:=ke, Line:=Li
 End Sub