我已经看到一些代码可以很好地捕获TextBoxes,Shapes,CommandButtons等中的MouseDown和MouseUp事件,如下所示:
Private Sub CommandButton1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'Do Stuff
End Sub
有没有办法在工作表上捕获MouseDown和MouseUp事件才能触发宏?
答案 0 :(得分:0)
如果您在普通用户表单中讨论过,那么您可以使用以下格式:
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
'Do things here
End Sub
我不相信它适用于工作表。