Dim nResult As Long
nResult = MsgBox(Prompt:="Erase your hard drive?", _
Buttons:=vbOKCancel)
If nResult = vbCancel Then
MsgBox "You cancelled..."
Else
MsgBox "Just kidding!"
End If
Sub ABCD()
Dim ans As Long
ans = MsgBox("Ok or Cancel?", vbOKCancel)
If ans = vbOK Then
MsgBox "You clicked OK"
ElseIf ans = vbCancel Then
MsgBox "You clicked cancel"
End If
End Sub
Dim nResult As Long
nResult = MsgBox(Prompt:="Erase your hard drive?", _
Buttons:=vbOKCancel)
If nResult = vbCancel Then
MsgBox "You cancelled..."
Else
MsgBox "Just kidding!"
End If
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.