VBA Challenge 3!
Just to get us warmed up, here's our weekly VBA challenge!
Finally, you're going to create your own game, based on the vba warmups from the last few weeks!
In your VBAChallenges XLS file, create a Sub called GuessingGame. Our sub will do the following:
- Create a new random number between 0 and 100 (check your previous challenges to find out how to do this).
- Ask the user to enter a number.
- Check whether the user has guessed the number correctly - if so, you should use a MsgBox to say "Congratulations! You got it!"
- If the user's guess is higher than your number, your program should respond with a MsgBox saying "Too high", or if it's lower, "Too low"
Once we've got that working, we'll modify our if-statement into a while loop so that our game will keep on asking you to guess the number as long as you don't get it right!
0 Comments:
Post a Comment
<< Home