📜  if 输入框取消 vba 代码示例

📅  最后修改于: 2022-03-11 14:51:53.141000             🧑  作者: Mango

代码示例1
Private Sub test()
    Dim result As String
    result = InputBox("Enter Date MM/DD/YYY", "Date Confirmation", Now)
    If StrPtr(result) = 0 Then
        MsgBox ("User canceled!")
    ElseIf result = vbNullString Then
        MsgBox ("User didn't enter anything!")
    Else
        MsgBox ("User entered " & result)
    End If
End Sub