?Timer 59252.75 ?Timer / (60 * 60) 16.46401 ?Time 4:27:58 PM ?Date 10/12/2007
What does Timer do? Hint: Try View menu, Immediate and type ?Timer (Also try this one: ?Timer / 3600 and ?Timer / (60 * 60) to see the result). How do you write a Do While loop? Do While condition What is the condition? < <= loop body (VBA statements) > >= Loop = <> What time is it Timer + 300 if right now ?Timer / 3600 gives 12.0 when you press enter? (View menu, Immediate window in VBA). - - What does the actor (variable) stopTime do in the pause or doPause()? List all of the lines of code that stopTime will occur in. What does the actor (VBA variable) currentTime do? What role does it play in the Sub doPause()? What statements or lines of code does it play a part in? What does DoEvents do? What things have to be done BEFORE the Do While condition line? What things (statements) have to be done WITHIN the loop body? 1. BEFORE loop gets started statements 2. Do While some logical condition 3. loop body statement (actions) 4. Loop If you study these questions with pen in hand, and also try them at the computer, you will get 100% on the question that requires you to write and to use a pause() or a doPause() Sub. What is the difference between Sub pauseHalfSecond() and Sub doPause(pauseAmount As Single) Write the code for BOTH of these. Which one has 0.5 inside it, and which one has pauseAmount inside it? 0.5 is a literal, and pauseAmount is a variable. --- -----------
Write the macro that takes the cells in columns A and B and rows 2 through 40 and does the following: 1. counts how many of the cells contain numbers that are 100 or larger, and 2. puts the count into the cell with address F2 on the same worksheet. Note: I would show you an example screen snapshot of the spreadsheet on the blackboard or on the exam or on the Elmo projector. What do you have to know to do this? For Each loops n = 0 initializing a counter to zero ( 0 ) n = n + 1 counting with a counter, i.e. adding 1 to the counter n. If condition Then do whatever you want to do when condition is TRUE End If Range("F2").Value = n How to specify the cell on a worksheet and its .Value property so you can place a number or string there. Range("U2").Value = "Happy Homecoming UNI Panthers!" >= relational operator as in theCell.Value >= 100 -------------------- a Boolean condition that is True or False