The document contains code for a macro that displays multiple message boxes with different text and titles when a button is clicked, and also displays an input box to get user input and show it in a message.
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views
Coding Excel
The document contains code for a macro that displays multiple message boxes with different text and titles when a button is clicked, and also displays an input box to get user input and show it in a message.
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
Private Sub CommandButton1_Click()
MsgBox "INSERT TEXT", vbOKOnly + vbExclamation, "TITLE ON BOX"
MsgBox "INSERT TEXT", vbOKOnly, "TITLE ON BOX" MsgBox "INSERT TEXT", vbOKOnly, "TITLE ON BOX" ans = MsgBox("QUESTION", vbYesNo + vbQuestion, "TITLE ON BOX") If ans = vbYes Then MsgBox "INSERT TEXT if answer YES", vbOKOnly, "TITLE ON BOX" If ans = vbNo Then MsgBox "INSERT TEXT if answer NO", vbOKOnly, "TITLE ON BOX" ans = MsgBox("QUESTION", vbYesNo + vbQuestion, "TITLE ON BOX") If ans = vbYes Then MsgBox "INSERT TEXT if answer YES", vbOKOnly, "TITLE ON BOX" If ans = vbNo Then MsgBox "INSERT TEXT if answer NO", vbOKOnly, "TITLE ON BOX" b = Application.InputBox("INSERT TEXT TO DISPLAY") MsgBox "sayangku " & b, vbOKOnly, "TITLE ON BOX" MsgBox "INSERT TEXT", vbOKOnly, "TITLE ON BOX" MsgBox "INSERT TEXT", vbOKOnly, "TITLE ON BOX" MsgBox "INSERT TEXT", vbOKOnly, "TITLE ON BOX" MsgBox "INSERT TEXT", vbOKOnly, "TITLE ON BOX"