【问题标题】:Excel VBA InputBox Range Selection ButtonExcel VBA 输入框范围选择按钮
【发布时间】:2012-12-21 19:59:38
【问题描述】:

好的。所以我在一定程度上熟悉 VBA 中的 InputBox。我知道选择范围的Type:=8 要求。我的代码运行良好,允许我做我想做的事。

这是它的样子:

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

我一直在搜索各种在线资源,唯一一次又一次出现的是需要使用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)

有人知道怎么做吗?谢谢!

【问题讨论】:

    标签: vba excel


    【解决方案1】:

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

    【讨论】:

    • 当然,RefEdit 就像任何东西一样脆弱。我写了一篇关于将 InputBox 用作Alternative to Excel's Flaky RefEdit Control 的文章。它没有那么“好”,但它不会在 5% 的用户机器上崩溃。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-04
    • 2022-12-20
    • 2021-05-22
    • 1970-01-01
    • 2012-11-08
    • 1970-01-01
    • 2021-12-13
    相关资源
    最近更新 更多