Excel, VBA: How to pass multiple variables to .OnAction

后端 未结 1 1353
野趣味
野趣味 2020-12-06 18:14

I am trying to pass multiple variables to a .OnAction call for a button. I have not been able to find answers that relate to multiple variables, and I can do it with just o

相关标签:
1条回答
  • 2020-12-06 19:07

    Assuming that VarA and VarB are variants or numeric variables, this would work:

    .OnAction = "'Button_Click """ & strText & """," & varA & "," & varB & " '"
    

    If they are strings, you need to add two more double-quotes around each variable name.

    .OnAction = "'Button_Click """ & strText & """,""" & varA & """,""" & varB & """ '"
    
    0 讨论(0)
提交回复
热议问题