简体   繁体   English

Excel VBA InputBox范围选择按钮

[英]Excel VBA InputBox Range Selection Button

Ok. 好。 So I'm familiar with InputBoxs in VBA to some degree. 所以我在某种程度上熟悉VBA中的InputBoxs。 I'm aware of the Type:=8 requirement to select a range. 我知道Type:=8要求选择一个范围。 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. 但是,我想生成Exel在选择范围时自己生成的相同类型的输入框。

在此输入图像描述

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. 我一直在搜索各种在线资源,唯一一次又出现的是Type:=8需要使用。 The MS Help has also not been of much help. MS帮助也没有多大帮助。

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控件放在其上

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

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