【发布时间】:2018-05-10 21:40:31
【问题描述】:
Sub msgbox_icons()
Dim t As String, arg As Integer
t = "Message Box Icons Demo"
Do
arg = InputBox(prompt:="Enter below one of the integers: (16, 32, 48 or 64):", Title:=t)
If arg = 16 Then
MsgBox arg & "<=> Critical Message Icon", vbCritical + vbOK, t
ElseIf arg = 32 Then
MsgBox arg & "<=> Warning Query Icon", vbQuestion + vbOK, t
ElseIf arg = 48 Then
MsgBox arg & "<=> Warning Message Icon", vbExclamation + vbOK, t
ElseIf arg = 64 Then
MsgBox arg & "<=> Information Message Icon", vbInformation + vbOK, t
Else
MsgBox arg & "<=> non-existent icon type", vbOKCancel, t
End If
Loop
End Sub
当我按下取消按钮时,它告诉我我遇到了 13 类错误。我想知道如何解决它。另外,如果我同时按下输入框和消息框的取消按钮,我将如何结束宏。谢谢。
【问题讨论】:
-
错误出现在哪一行?
标签: excel vba macos inputbox do-loops