Microsoft Office
Looping over collections exercise
Relatively easy

This Microsoft Office LOOPING OVER COLLECTIONS exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl EXCEL 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: IKEA furniture - changing black to blue

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

1) Download the files needed to start this exercise: exercise-127.zip (and click here if you experience any problems unzipping this file after downloading it).
2) Create a macro which changes the colour of all the items of furniture from black to blue.  After running your macro, this is what you should see:
Exercise screen-shot 371 The colours have been changed for all black cells
3) The method you should use is:
  • Loop through all the cells in the range of cells from A1:J15 (say)
  • For each cell, test whether its Interior.ColorIndex property equals 1 (which happens to be black)
  • If it does, change it to 11 (which happens to be blue)
4) Save this workbook and close it down.

Thank you for showing an interest in this Excel 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 � Wise Owl Business Solutions Ltd 2007.  All rights reserved.  Design by Branches.