2012-12-21 81 views
4

好的。所以我在某种程度上熟悉VBA中的InputBoxs。我知道Type:=8要求选择一个范围。我的代码工作正常,并允许我做我想做的事情。Excel VBA输入框范围选择按钮

这是什么样子: enter image description here

不过,我想生成相同类型的输入框是Exel公司自身选择范围时所产生的。

enter image description here

我一直在通过各种在线资源和再度出现又一次的唯一搜索是使用Type:=8需求。 MS帮助也没有太多帮助。这里

对于completness的缘故是我的代码:

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) 

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

回答

3

你必须创建你自己的表格和put the RefEdit control on it

+0

谢谢!这有帮助! – rohrl77

+0

当然,RefEdit就像任何东西一样薄。我写了一篇关于使用InputBox作为[Excel的片状RefEdit控件的替代品]的文章(http://peltiertech.com/refedit-control-alternative/)。这不是“好”,但它不会在5%的用户机器上崩溃。 –