Exercise 7 - Recording and using macros

The following exercises deal with recording macros and using them in combination with different tools.

  1. You will use an existing weather sheet saatila7.xls as a base for the exercises. Save it to dive U an open it in Excel. A macro warning will appear as there are some macros in the workbook already. Enable macros as you will need them later on. Some vocabulary:
  2. There are two sheets, one containing the weather data and the other containing the conditions associated. There are input cells for entering the conditions according to which the contents of the other sheet are formed.
  3. Make a macro for inserting, editing or deleting weather data. Follow the plan and instructions below:
  4. Assign the new macro to a button as follows:
  5. Then create a macro that sorts the weather data in ascending order according to the temperature. Follow the plan below. Name the macro Sort_weather.
  6. Plan and create a macro that filters weather data that fills the conditions given:
  7. Plan and create a macro that removes the filter created above:
  8. Plan and create a macro for editing, inserting and deleting student data on the Kurssi (course) worksheet.
  9. Plan and create a macro:
  10. Merge the update macro to the student-inserting macro. You can copy the code of the previous macro to the latter. Carefully test the combination macro!
  11. There are macros called suojaukset_pois (unprotect) and suojaukset_paalle (protect) in your workbook. Try the macros on every worksheet.

Additional exercises

In the following additional exercises you can use the help of the program or brief VBA basic instructions.

  1. Try the taulukko (table) macro of the workbook used above. It transforms an activated Excel table to a HTML table. The macro has a shortcut key combination CTRL-SHIFT-C.
  2. Try the two self made functions omasumma and sarja in the workbook. The functions are presented both in the VBA basic instructions and on the lecture notes.
  3. Create a function accoring to the plan below:
  4. Create a function accoring to the plan below:
http://appro.mit.jyu.fi/2002/kevat/ohjelmistot/english/demo7.html
© Petri Heinonen ()<URL: http://www.mit.jyu.fi/peheinon/>
2002-03- 5T15:17:28Z