Tuesday, 14 February 2017

What is the difference between message box statement and message box function?

MsgBox() function

MsgBox Statement
Display the message in a dialog box and waits for the user to choose the button
1
It display only the message and does not depend on the user choice.
The general syntax is:
MsgBox(prompt, buttons, title, helpfile, context)
2
The general syntax is:
MsgBox Text As String [,Type As Integer [,Dialogtitle As String]]
MsgBox() return a value.
3
It does not any value.
MsgBox() Function has default title.
4
MsgBox statement does not have default title.
For example:
Ans = MsgBox("Are u sure?", vbYesNo)
5
MsgBox ”Good Morning”

No comments:
Write comments