vba 如何在 Excel 工作表上放置按钮或文本框?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1925427/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to put a button or textbox on an excel worksheet?
提问by l--''''''---------''''''''''''
does anyone know how to place buttons or textboxes on worksheet with vba or manually?
有谁知道如何使用 vba 或手动在工作表上放置按钮或文本框?
回答by user234234
It always helps to know which version of Excel you're working in.
了解您正在使用的 Excel 版本总是有帮助的。
In Excel 2003, right-click any toolbar and enable the Forms toolbar. Select the Button from there. This type of button can be assigned to a macro so that when someone clicks it, the macro is executed.
在 Excel 2003 中,右键单击任何工具栏并启用“表单”工具栏。从那里选择按钮。这种类型的按钮可以分配给一个宏,这样当有人点击它时,宏就会被执行。
In Excel 2007, go to the Excel menu and select Excel Options. Select Popular and then check the Show Developer Ribbon option. On the Developer ribbon, select the Insert... pulldown and you'll be able to do basically the same series of steps as above.
在 Excel 2007 中,转到 Excel 菜单并选择 Excel 选项。选择“流行”,然后选中“显示开发人员功能区”选项。在 Developer 功能区上,选择 Insert... 下拉菜单,您将能够执行与上述基本相同的一系列步骤。
HTH, Neb
HTH, 内布拉斯加州
回答by user4716686
In Excel 2013 add the "Insert controls" to the quick access toolbar.
在 Excel 2013 中,将“插入控件”添加到快速访问工具栏。
select the drop-down arrow from the insert controls, then choose the control you wish to add to the worksheet (double click on that control to add code to it).
从插入控件中选择下拉箭头,然后选择要添加到工作表的控件(双击该控件以向其添加代码)。