简体   繁体   English

在 Excel VBA 中双击执行宏

[英]Execute macro on double click in Excel VBA

I am not sure if I am making sense, we have an option to run macro on before double click event in excel.我不确定我是否有道理,我们可以选择在 Excel 中的双击事件之前运行宏。 But is it possible to execute after double click.但是是否可以双击后执行。

I think you misunderstand the Worksheet.BeforeDoubleClick event handler.我认为您误解了Worksheet.BeforeDoubleClick事件处理程序。 The definition taken from here :取自此处的定义:

Occurs when a worksheet is double-clicked, before the default double-click action.在默认双击操作之前双击工作表时发生。

So your users will be able to double click on a worksheet and your macro can run using that as an event handler.因此,您的用户将能够双击工作表,并且您的宏可以将其用作事件处理程序来运行。 The code doesn't run before the double click per se but rather after the user has performed the action.该代码本身并不鼠标双击运行之前,但用户已经执行的行动,而之后

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

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