Microsoft Developer
Messages and variables exercise
Harder than average exercise

This Microsoft Developer MESSAGES AND VARIABLES 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: Using MSGBOX to ask whether to show answer

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

1) Create a new workbook, and type 42 into cell A1 and press Enter.  This is the answer.
2) Select a different cell on a different sheet.
3) Create a macro which will take you to the answer IF you want to see it.  Your macro should first ask use the MsgBox function to ask whether you want to see the answer:
Exercise screen-shot 2008 Note that by default we have made sure that the second (NO) button is the one selected
Training exercise hint You will probably find the courseware manual section on the MsgBox function useful for this exercise.
4) Your macro should now select the answer on the correct worksheet if your user chooses Yes, or display the following message otherwise:
Exercise screen-shot 2009 This is included just so something happens in either eventuality
5) Save this workbook as Example of Continue Question.xlsm, then 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..