Option Explicit
Private Sub Command1_Click()
Select Case MsgBox("Msgbox 1", vbOKOnly, "Command1")
Case vbOK
Print "OK"
End Select
End Sub
Private Sub Command2_Click()
Select Case MsgBox("Msgbox 2", vbYesNo, "Command2")
Case vbYes
Print "Yes"
Case vbNo
Print "No"
End Select
End Sub
Private Sub Command3_Click()
Select Case MsgBox("Msgbox 3", vbYesNoCancel, "Command3")
Case vbYes
Print "Yes"
Case vbNo
Print "No"
Case vbCancel
Print "Cancel"
End Select
End Sub