VBA的“添加"按钮,设置标题并将其链接到方法 [英] VBA Add button, set the caption and link it to a method

查看:226
本文介绍了VBA的“添加"按钮,设置标题并将其链接到方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在新工作表上添加一个按钮,设置标题并将其链接到模块中的方法.任何帮助,将不胜感激.谢谢!

I want to add a button on a new worksheet, set the caption and link it to a method in a module. Any help would be appreciated. Thanks!

推荐答案

Dim b As Excel.Shape
Set b = ActiveSheet.Shapes.AddFormControl(xlButtonControl, 10, 10, 100, 100)
b.OnAction = "AMacro"
b.OLEFormat.Object.Text = "Run a macro"

这篇关于VBA的“添加"按钮,设置标题并将其链接到方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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