'Button Selected Constant Value
'OK vbOK 1
'Cancel vbCancel 2
'Abort vbAbort 3
'Retry vbRetry 4
'Ignore vbIgnore 5
'Yes vbYes 6
'No vbNo 7
Sub MsgBoxDemo()
Dim Answer As Long
Answer = MsgBox("Message", vbQuestion + vbOKCancel, "Error")
If Answer = vbOK Then
MsgBox "OK"
End If
If Answer = vbCancel Then
MsgBox "Cancel"
End If
End Sub