Message Box


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
 
The message box displays  Yes, No and Cancel buttons.
 

Comments

Popular posts from this blog

50 Excel VBA Oral Interview Questions