简体   繁体   中英

Excel VBA InputBox Range Selection Button

Ok. So I'm familiar with InputBoxs in VBA to some degree. I'm aware of the Type:=8 requirement to select a range. My code works fine and allows me to do what I want to.

This is what it looks like: 在此输入图像描述

However, I want to generate the same type of inputbox that Exel itself generates when selecting a range.

在此输入图像描述

I've been searching through various online resources and the only thing that comes up again and again is that Type:=8 needs to be used. The MS Help has also not been of much help.

For completness' sake here is my code:

Dim SelRng1 As Range
Dim SelRng2 As Range

Set SelRng1 = Application.InputBox(Prompt:="Please select the first table (headers included)", Title:="Select Table 1", Type:=8)
Set SelRng2 = Application.InputBox(Prompt:="Please select the second table (headers included)", Title:="Select Table 1", Type:=8)

Anyone know how to do this? Thanks!

您必须创建自己的表单并将RefEdit控件放在其上

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