Microsoft Developer
Looping over collections exercise
Average difficulty

This Microsoft Developer 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: Listing command bar names

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

1) Create a new workbook, and save this as Listing Commandbars.xls.
2) Create a new macro within this workbook which:
  • Loops over all of the Excel commandbars; and
  • Shows the name of each in the immediate window.
Training exercise hint Even though you have probably never seen the CommandBars collection before, all you need to know is that each Excel commandbar has a Name property.  Isn't Visual Basic beautiful?
3) Save this file 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 copyright Wise Owl Business Solutions Ltd 2008.  All rights reserved..