title: Understanding what response codes come back from MsgBox
body: <p>I'm very new to programming and I'm just starting to learn VBA with excel. I came across on this website and did the examples here but I have question about this code: </p>
  
  <p>I know the variables are declared using "Dim" statement "Message" here is the variable with a data type of integer. What I don't clearly understand is; what is the meaning of "6" here and "7". I believe they come from somewhere. But as I just started learning this program, I don't have any idea. Could you please tell me how it end up to "6" and "7". I believe there is some basis here</p>
  
  <pre><code>Private Sub CommandButton1_Click()
  Dim message As Integer
  message = MsgBox("Click Yes to Proceed, No to stop", vbYesNoCancel, "Login")
  If message = 6 Then
  Range("A1").Value = "You may proceed"
  ActiveWorkbook.Activate 
  ElseIf message = 7 Then
  ActiveWorkbook.Close
  End If
  
  End Sub
  </code></pre>
  
  <p>Thank you for your help:-)</p>
  
  <p>=======</p>
  
  <p>Thanks guys for the answers, they're very helpful. Yes this thread has been already posted in superuser site. I was informed that this question should belong here so I posted it here after reading that they will do it automatically from superuser to stackoverflow. </p>
  
  <p>thanks once again</p>