CS2113 - Programming with VBA/EXCEL
Fall 2007
My lecture notes:
Other examples covered in lecture but may not
be in the above notes (they are separated loosely into categories, although
many examples actually fall into multiple categories:
Branches:
· An example involving using
the Select Case statement: TestSwitch.xls
· Computing roots of a
quadratic function (involving branches): quadraticEquation.xls
Loops:
· An example using a nested
double loop to draw the stars on the American flag: AmericanFlag.xls
· Computing the factorial
function using iteration and the use of a recursive function: TestFactorial.xls
· Summing the Taylor series
to compute the cosine function: cosEvaluate.xls
· Summing the Taylor series
to compute the cosine function (better control of the number of terms): cosEvaluate2.xls
· Summing the Taylor series
to compute the cosine function (better control of the number of terms):cosEvaluate3.xls
· An example using a
do/while loop for data validation: doWhile.xls
Functions:
· An example involving
parameters of a function from the book: ParamList.xls
· An example illustrating
call-by-value and call-by-reference arguments of a function from the book: ValRef.xls
Arrays and Records:
· Problem 13.5 (mean and
standard deviation): problem13p5.xls
· Problem 13.11 (Equation of
State): problem13p11.xls
· Temperature convention
example from book: temperatureArray.xls
· Finding the lowest score
from an array of scores: lowestScoreArray.xls
· Finding the differences in
scores from the highest score: differenceScores.xls
· Searching an array for a
target value: Array1DSearch.xls
Miscellaneous:
· The kickCalc example from
our textbook: KickCalc.xls
· Count number of items in
spreadsheet (rows): CountRow.xls
· Count number of items in
spreadsheet (columns): CountColumn.xls
· Sorting items in Excel: Sorter.xls
Midterm problems:
Homework Assignments (from our textbook):
· Problems: 3.2 and 3.3 (Due
September 19)
· Problems: 8.1 and 8.3 (Due
October 2)
· Problems: 11.7 and 11.6
(Due October 9)
· Problem: Write a VBA sub
procedure, named compute_x, that ask the user to input integer, x, using an
InputBox, then computes that final value of x according to the flow chart for
problem 12.2 on p. 143 of our textbook. The final value of x should be
displayed using a message box. (Due October 15)
· Problems: 13.5 and 13.11
(Due Nov. 26)