简体   繁体   English

如何将范围输入添加到VBA用户窗体

[英]How to add Range Input to VBA UserForm

Many of the built in excel dialog boxes use a range input box like this one: 许多内置的excel对话框都使用如下所示的范围输入框:

Excel中的范围输入框

Im not sure if they are called "Range Inputs" or whatever. 我不确定它们是否称为“范围输入”或其他名称。 This is taken from "Data Analysis" in Excel, in case you are wondering. 如果您想知道的话,这取自Excel中的“数据分析”。 When you click on the little image in the text box, the dialog box disappears and excel allows you to select a range of cells, which it then places in the the text box. 当您单击文本框中的小图像时,对话框会消失,并且excel允许您选择一个单元格区域,然后将其放置在文本框中。 If there is a way to incorporate this into a UserForm, please let me know 如果有办法将其合并到UserForm中,请告诉我

Thanks in advance! 提前致谢!

It is called RefEdit Control and works similar to that built in Boxes. 它称为RefEdit控件 ,其工作原理类似于Boxes中内置的控件 If your toolbox does not have a RefEdit control, set a reference to RefEdit control. 如果您的工具箱没有RefEdit控件,请设置对RefEdit控件的引用。 Click Tools, References, and check Ref Edit Control. 单击工具,参考,然后选中参考编辑控件。

Here is an Example how to use it: http://www.excel-easy.com/vba/examples/userform-ranges.html 这是一个示例如何使用它: http : //www.excel-easy.com/vba/examples/userform-ranges.html

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

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