INF 110 In-Chapter Excel Chapter 3
INF 110 In-Chapter Excel Chapter 3
(Workbook named
In-ChapterExcel3LastName.xlsm) (Download VLC
Video Player)
Use the following set of directions as a guideline:
Your Turn! (page 72)
Number Guess example
(Create a Worksheet named NumberGuessingGameP72) (See
video) (Download video)
- Type in code on page 72
- To test the code put the VBA
statement (Call NumberGuess) in the Worksheet_SelectionChange event of the
spreadsheet
- Click on a cell in the
spreadsheet then type in your guess, try 7 first, next try 5 then 6
- Keep entering numbers until
you guess incorrectly
- Use the Alt-Print Screen keys
to capture the Screen-shots for each message box (3 screen-shots total)
- Paste these screen-shots into
the spreadsheet to show that the code is working properly.
- Change the Name of sheet1 tab
at bottom to NumberGuessingGameP72
- Save the Workbook as an Excel
Macro-Enabled Workbook (*.xlsm) in the Save As dialog box using the name
In-ChapterExcel3LastName.xlsm.
Your Turn!
(page 74) Working days and times example
(Create a Worksheet named
WorkTimeP74) (See
video) (Download
video)
- Type in code on page 74, change
the numbers in the 2nd If statement from 0 and 6 to 1 and 7 for the program
to work correctly.
-
To
test the code put the VBA statement (Call myTime) in the
Worksheet_SelectionChange event of the spreadsheet
- Click on a cell in the
spreadsheet to run the program.
- Use the Alt-Print
Screen keys to capture the Screen-shots for each message box (1 screen-shots
total)
- Paste these
screen-shots into the spreadsheet to show that the code is working properly.
- Change the Name of sheet2 tab at bottom to WorkTimeP74
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Your Turn! (page 58)
Parameters for MouseDown event of a command Button
(Create a Worksheet named ParametersP58) (See
video) (Download video)
- Create a user interface by
typing in the headings into row one of the spreadsheet as shown on page 58
- create a command button on the
spreadsheet in cells (B4:C5) as shown on page 58
- type in code on page 58,
- test the program by clicking in
different areas of the command button using both the left and right mouse
buttons and holding down the Shift, and Ctrl keys on the keyboard.
- Notice how the parameters
Button, Shift, X, and Y change in value as you interact with the command
button
- Change the Name of sheet3 tab at bottom to ParametersP58
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Your Turn! (pages 61 and
62) Adding Two Numbers Using Procedures
(Create a Worksheet named AddTwoNumbersP61-62) (See
video) (Download video)
- Type in code on pages 61-62,
- to test the code put the VBA
statement (Call Main) in the Worksheet_SelectionChange event of the
spreadsheet,
- click on a cell in the
spreadsheet then type in your two numbers to be added (Use 10 and 20).
- Use the Alt-Print
Screen keys to capture the Screen-shots for each Input box and the message
box (3 screen-shots total)
- Paste these
screen-shots into the spreadsheet to show that the code is working properly.
- Change the Name of sheet4 tab at bottom to AddTwoNumbersP61-62
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Your Turn! (page 67)
Adding Raising a Number to a Power Using Functions
(Create a Worksheet named RaiseNumbersToPowerP67) (See
video) (Download video)
- Type in code on page 67
- to test the code put the VBA
statement (Call TestPower) in the Worksheet_SelectionChange event of the
spreadsheet,
- click on a cell in the
spreadsheet then type in a number and its power or exponent using 12 and 2
- Use the Alt-Print
Screen keys to capture the Screen-shots for each Input box and the message
box (3 screen-shots total)
- Paste these
screen-shots into the spreadsheet to show that the code is working properly.
- Change the Name of sheet5 tab at bottom to RaiseNumbersToPowerP67
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Your Turn! (page 63) Using
ByRef and ByVal in Procedures
(Create a Worksheet named ByValandByRefP63-64) (See
video) (Download video)
- Type in code on page 63,
- to test the code put the VBA
statement (Call Main) in the Worksheet_SelectionChange event of the
spreadsheet,
- click on a cell in the
spreadsheet to get the message box on the top of page 64 in Excel book.
- Use the Alt-Print
Screen keys to capture the Screen-shots for each message box (1 screen-shots
total)
- Paste these
screen-shots into the spreadsheet to show that the code is working properly.
- Change the Name of sheet6 tab at bottom to ByValandByRefP63-64
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Use the header
feature of Excel to enter the following course information
(INF 110-00s, Business Programming, Your Name Here.
Your Turn! (see slide 57
Excel 3)
Draw a flowchart to solve the following problem.
(Create a Worksheet named
StudentLetterGradeFlowchart) (See
video) (Download video)
- Draw a flowchart using shapes in PowerPoint to solve the following
problem.
- Input a student's name and test score out of 100.
- Program
should match the test score to a letter grade.
- Print out the student's
name and letter grade use the following table.
Exam Score |
Assigned Grade |
90 and above |
A |
80-89 |
B |
70-79 |
C |
60-69 |
D |
Below 60 |
F |
- Group all the Shapes in the flowchart in PowerPoint, by selecting all
the shapes and flow lines, then right-click and select Group from the
short-cut menu
- Copy
and Paste this flowchart image into the spreadsheet cell B2 to display the
flowchart diagram in the spreadsheet, resize as needed.
- Change the Name of sheet7 tab at bottom to
StudentLetterGradeFlowchart
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
Your Turn! (see slide 58
Excel 3)
Draw a flowchart to solve the following problem.
(Create a Worksheet named
WeightChargeFlowchart)
- Input the weight of a parcel.
.
- Program should determine the delivery charge for that parcel and
print it out. (Use the following table)
Parcel weight (kg)
|
Cost per kg($) |
< 2.5 kg |
$3.50 per
kg |
2.5 to 5 kg |
$2.85 per
kg |
> 5 kg |
$2.45 per
kg |
- Group all the Shapes in the flowchart in PowerPoint, by
selecting all the shapes and flow lines, then right-click and select Group
from the short-cut menu
-
Copy and Paste this flowchart image into the spreadsheet cell B2 to display
the flowchart diagram in the spreadsheet, resize as needed.
- Change the Name of sheet8 tab at bottom to
WeightChargeFlowchart
- Save the Workbook as an Excel Macro-Enabled Workbook (*.xlsm) in the
Save As dialog box using the name In-ChapterExcel3LastName.xlsm
More Practice
Flowcharting and Coding Problems from Web Page
(Students should submit the
electronic version of all worksheets in the workbook using the drop box
by clicking the InChp3 link under on the Assignments link,
when you submit the assignment challenges at the end of the chapter.
In-Chapter work from this chapter (In-ChapterExcel3LastName.xlsm), each spreadsheet in
the In-Chapter Excel workbook should use the following names (ParametersP58, AddTwoNumbersP61-62, ByValandByRefP63-64,
RaiseNumbersToPowerP67, NumberGuessingGameP72, WorkTimeP74,
StudentLetterGradeFlowchart,
and WeightChargeFlowchart), reflecting the page in the text from
which the work comes. Substitute your last name for LastName
listed in file names above)