简体   繁体   中英

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中的范围输入框

Im not sure if they are called "Range Inputs" or whatever. This is taken from "Data Analysis" in Excel, in case you are wondering. 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. If there is a way to incorporate this into a UserForm, please let me know

Thanks in advance!

It is called RefEdit Control and works similar to that built in Boxes. If your toolbox does not have a RefEdit control, set a reference to RefEdit control. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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