如何编写用于单击命令按钮的VBA代码? [英] How can I write a VBA code for clicking a command button?

查看:423
本文介绍了如何编写用于单击命令按钮的VBA代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好:

如何编写单击命令按钮的VBA代码?基本上,如果点击"是",我想写一个if。命令按钮,它将运行maroc。虽然我不知道如何编写代码。感谢您的帮助!

B.regards / Yaping

推荐答案

您好,

您要么将一个宏分配给OnAction属性或在Click事件中添加代码。

但这一切都取决于什么类型的按钮,你在哪里使用它(userform / worksheet)和哪个应用程序。
你能吗?提供更多信息?

Hi,

You either assign a macro to the OnAction property or add code in the Click event.

But it all depends on what type of button, where you are using it (userform/worksheet) and which application.
Can you provide more information?


这篇关于如何编写用于单击命令按钮的VBA代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆