我的代码
Dim a As Integer
a = InputBox("Enter the number", "Program", "", 7000, 6000)
If a = Empty Then
' do code...
Else
MsgBox "Enter the number."
End If
Run Code Online (Sandbox Code Playgroud)
如果我留下一个空字段,Excel将返回Type Mismatch错误.我想显示一条消息.