Microsoft Excel 2007
Loops and conditions exercise
Average difficulty

This Microsoft Excel 2007 LOOPS AND CONDITIONS exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl EXCEL 2007 VISUAL BASIC course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Loop over coasters, showing wooden ones

A full answer to this exercise is provided as part of the training course!

1) Download the files needed to start this exercise: exercise-911.zip (and click here if you experience any problems unzipping this file after downloading it).
2) The above workbook contains a list of rollercoasters - column C gives their type:
Exercise screen-shot 2013 Not many wooden ones here
3) Write a macro which:
  • Selects cell A2 as a starting point
  • Loops down until it reaches a blank cell, checking the type of each and adding wooden ones to its list.
4) Your final message to be displayed should look like this:
Exercise screen-shot 2014 Use VbCrLf to create a carriage return in your message to be displayed
Training exercise hint Somewhere within your macro you will need a command like this: MessageSoFar = MessageSoFar & vbCrLf & ActiveCell.Value
5) Save this file as Show wooden coasters.xlsm and close it down.

Thank you for showing an interest in this Excel 2007 Visual Basic training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content copyright Wise Owl Business Solutions Ltd 2008.  All rights reserved..