Excel要怎么做到点击某个单元格即执行宏?

126 2023-12-25 11:41

你应该把那段代码写在

Workbook_SheetSelectionChange里面Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)If Target.Row = 1 And Target.Column = 1 ThenMsgBox ("点击了第1个单元格")End IfEnd Sub

顶一下
(0)
0%
踩一下
(0)
0%
相关评论
我要评论
点击我更换图片