Messages and User Inputs
Exercise 5.02
Exercise 5.02
The aim of this exercise is to allow the user to add items to a list using input boxes.
Files Needed
Click here to download the file you need for this exercise.
Instructions
- Open the Lottery List.xlsx file, create a new module and add a new subroutine.
- Congratulations: you've won the lottery! Your task is to write a procedure which uses input boxes to build a shopping list.

Feel free to delete the suggested items that are already in the list.
- Write code to display an Excel input box which asks the user to enter the name of the item they wish to purchase. Capture the result in a String variable.

Be as extravagant as you like.
- Add code to check that the user entered a value before clicking OK. If not, display a message and exit from the procedure.

We don't want to add an un-named item to the list.
- Add code which displays a message and exits from the procedure if the user clicks Cancel on the input box.

Your message can be gently encouraging or downright pushy.
- Add a second Excel input box which asks the user the estimated cost of the item and return its result to a Double variable. Make sure that the user can only enter a number.

If you don't enter a number you should see this warning.
- Write code to add the new item to the end of the list.

The new item should appear at the end of the list.
Answer Files
Click here to download a file containing a suggested answer.
This page has 0 threads
Add post