首页 文章

VBA单击Excel工作表中的按钮

提问于
浏览
2

我需要单击Excel工作表上的按钮(FormControl)并通过VBA代码运行分配给它的宏 .

我尝试了这里建议https://stackoverflow.com/questions/130166/clicking-command-button-from-other-workbook,但它对我不起作用 .

还有其他办法吗?

3 回答

  • 1

    这样做的方法非常简单,即使它没有真正记录 .

    CommandButton1.Value = True
    
  • -1

    你真的试过吗?因为你想要exaclty是什么suggested there .

    Application.Run Activesheet.Shapes(1).OnAction
    
  • 4

    如果在工作表中 . 我过去用过这个,它有效!

    Sheet1.CommandButton1_Click
    

    其他

    Sheets("Sheet Name").CommandButton1_Click
    

相关问题