With Microsoft Excel and VBA editor, you can create Sub functions. And then this article shows you the message in VBA edit with VBA code.
So I have 5 message dialog box examples to show you.
Simple Message
For a simple message dialog box, create a sub-function “SimpleMessage()” that it has “Welcome to Puthea Training” message for informing when open this Excel file. And it’s one-line statement in the dialog box.
Option Explicit
Sub SimpleMessage()
MsgBox ("Welcome to Puthea Training")
End Sub
New Line Message
For a new line message dialog box, create a sub-function “NewLineMessage()” that has two line statements “Welcome to Puthea Training Channel” is the first line, and “Please help me subscribe” is the second line. They were split by constant vbNewLine.
Option Explicit
Sub NewLineMessage()
MsgBox ("Welcome to Puthea Training Channel" & vbNewLine & "Please help me subscribe")
End Sub
Input Message
Create a sub-function “InputMessage()” that has the message “Please Give Me Your Name In Box” and Input box in the message dialog box to user input value inside and pass a value from the Input box to Cell “A1”.
Option Explicit
Sub InputMessage()
Dim valInput As String
valInput = InputBox("Pleae Give Me Your Name In Box")
Range("A1").Value = valInput
End Sub
Yes/No Message
Create a sub-function “YesNoMessage()” and use constant “vbYesNo”. After you create this sub-function with the below code, it will pop up the decision message “Yes/No” to the user’s answer.
Option Explicit
Sub YesNoMessage()
Dim valQ As Integer
valQ = MsgBox("Do you want to save?", vbYesNo, "Yes or No")
If valQ = vbYes Then
Range("A2").Value = "You click Yes"
Else
Range("A2").Value = "You Click No"
End If
End Sub
Information Message
For Information Message dialog box look like a simple message dialog box, but It has a Information icon in dialog.
Option Explicit
Private Sub btnInfo_Click()
Dim valInfo As String
valInfo = MsgBox("Save successfully!", vbInformation, "Information")
End Sub
Note : Information Message Type (vbMsgboxStyle) : have vbInformation, vbQuestion, vbCritical, vbExclamation, vbSystemModal
What for mad thought?
Completely I share your opinion. I think, what is it excellent idea.
Certainly. I join told all above.
I regret, that I can not participate in discussion now. I do not own the necessary information. But this theme me very much interests.
Excellently)))))))
https://amic.co.in/catalog/font/
Regardless of how you type this, you get the same result. Creating our Message Box. This is an example of a message box in its simplest form.
This example uses the MsgBox function to display a critical-error message in a dialog box with Yes and No buttons. The No button is specified as the default response. The value returned by the MsgBox function depends on the button chosen by the user.
You need to take part in a contest for one of the highest quality sites on the net. I am going to recommend this site!