Q3 Lesson 1_ InputBox and MsgBox
Q3 Lesson 1_ InputBox and MsgBox
Basic Programming
Quarter 3: Week 2
Lesson 2.2:
Commonly Used
Function:
InputBox
Specific Learning Objectives
At the end of the lesson, you should be able to:
3
When you are using your computer, do
you see some of this?
4 4
Lesson 2.2:
What are
InputBox?
InputBox
Displays a prompt in a dialog box,
waits for the user to input text or
click a button, and returns a String
containing the contents of the text
box.
Example
Title Bar
Commonly Used
Function:
MsgBox
Specific Learning Objectives
At the end of the lesson, you should be able to:
11
When you are using your computer, do
you see some of this?
12 12
How are the previous images different
from Input Boxes?
13 13
Lesson 2.3:
What are
MsgBox?
MsgBox
It displays a message in a dialog
box and wait for the user to click
a button and returns an integer
indicating which button the user
clicked.
Example
Title Bar
Return Values:
Icons Value Description
vbOk 1 Ok button
vbCancel 2 Cancel Button
vbAbort 3 Abort Button
vbRetry 4 Retry Button
vbIgnore 5 Ignore Button
vbYes 6 Yes Button
vbNo 7 No Button
Example:
Buttons & Return Values
Sample = MsgBox ( “Do you want to run Macro1?” , vbQuestion + vbYesNo,
“Microsoft Excel” )
Sample = MsgBox ( “Do you want to run Macro1?” , 32 + 4, “Microsoft Excel” )