Message Box "Login"

 
The code for the third button:
 
Private Sub CommandButton3_Click()
Dim message As Integer
message = MsgBox("Click Yes to Proceed, No to stop", vbYesNo, "Login")
If message = 6 Then
Range("A1").Value = "You may proceed"
ActiveWorkbook.Activate
ElseIf message = 7 Then
ActiveWorkbook.Close
End If
End Sub
 
The nessage box displayes Yes and No buttons


Comments

Popular posts from this blog

50 Excel VBA Oral Interview Questions