gpt4 book ai didi

excel - Application.InputBox 的枚举

转载 作者:行者123 更新时间:2023-12-03 01:56:03 28 4
gpt4 key购买 nike

每当我使用 Application.InputBox() 时,我都会调出 VBA 帮助来提醒我要使用哪种 Type:

Sub MAIN()
Dim s As String

s = Application.InputBox(Prompt:="enter data", Type:=2)
End Sub

是否存在,或者我可以为 Type 创建一个枚举,以便我可以编写如下代码:

Sub MAIN()
Dim s As String

s = Application.InputBox(Prompt:="enter data", Type:=vbString)
End Sub

对我来说,记住枚举比记住任意整数更容易。

最佳答案

不,没有,但您可以自己创建一个枚举:

Public Enum InputBoxType
ibtFormula = 0
ibtNumber = 1
ibtText = 2
ibtBoolean = 4
ibtRange = 8
ibtError = 16
ibtArray = 64
End Enum

关于excel - Application.InputBox 的枚举,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37117448/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com