ENV* K105

Assignment #8--Macros
Due 11/08/05

In this assignment you will learn about Macros as described in Chapter 21 of Using Microsoft Office 97 (see handout). A macro is a series of commands that an application carries out automatically. In Office 97 (and later) applications, macros are written in a computer language called Visual Basic for Applications (VBA). This is actually the same as the programming language Visual Basic (VB). Fortunately, you do not need to know any VB to actually record and use macros. Nonetheless, the more you know, the more powerful, flexible and reliable your macros will be.

  1. Download assignment8files.zip (click the link; save the file to disk, then double click it to open. Extract the files to a USB drive, your I:\ drive or another folder). Read all of this assignment.
  2. Before you can run any of the macros I wrote, you need to decrease the Macro Security level to Medium. Open Excel. Choose Tools, Macro, Security.... Select the Medium radio button and Click OK. Close Excel.
  3. Read Chapter 21 (in the handout), working as many examples as you can.
  4. Create a neat little calculator starting with the Weak Acid pH Calculator you made last week.
  5. Add a command button.
  6. Add another command button.
  7. Sub NewData()

    Data = InputBox("Acid Concentration, in mM", "Enter Acid Concentration")
    Range("$F$9").Value = Data
    Data = InputBox("Salt Concentration, in mM", "Enter Salt Concentration")
    Range("$F$10").Value = Data

    End Sub

  8. Add a combo box.
  9. Clean up the worksheet.
  10. Use WebCT to send me all your files compressed into a single zip folder. Be sure to include your initials in the name of the zip folder and of each file in the folder.

Top | ENV* K105 home | Environmental ET home

Anthony G Benoit
Room 205 (860) 885-2386