Excel VBA InputBox范围选择按钮

时间:2012-12-21 11:42:26

标签: vba excel-vba excel

确定。所以我在某种程度上熟悉VBA中的InputBoxs。我知道选择范围的Type:=8要求。我的代码工作正常,允许我做我想做的事。

这就是它的样子: enter image description here

但是,我想生成Exel在选择范围时自己生成的相同类型的输入框。

enter image description here

我一直在搜索各种在线资源,而且一次又一次出现的问题是Type:=8需要使用。 MS帮助也没有多大帮助。

为了完整起见,这里是我的代码:

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)

任何人都知道如何做到这一点?谢谢!

1 个答案:

答案 0 :(得分:3)

您必须创建自己的表单并put the RefEdit control on it