简体   繁体   English

形成按钮宏的参数?

[英]Parameter to form button macro?

I am trying to pass a parameter from a form button to a macro called "Sub ExcelRangeToPowerPoint(s As String)" 我试图将参数从表单按钮传递到名为“ Sub ExcelRangeToPowerPoint(s as String)”的宏

I assign the macro using the following syntax as indicated in an other thread: 'ExcelRangeToPowerPoint("mystring")' 我使用其他线程中指示的以下语法分配宏:'ExcelRangeToPowerPoint(“ mystring”)'

When firing the button, I get an error: impossible to execute macro ''ExcelRangeToPowerPoint("mystring")'' .... 触发按钮时,出现错误:无法执行宏''ExcelRangeToPowerPoint(“ mystring”)“...。

Any idea? 任何想法?

This is the form code 这是表格代码

Private Sub CommandButton1_Click()

    Module1.test

End Sub

This is the module code 这是模块代码

Sub test()
    MsgBox UserForm.CommandButton1.Value
End Sub

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM