How to display the number of dice player rolled in vba in the message box after finish the line
The ‘START’ point must be located in cell A5 and the ‘FINISH’ point in cell AN5.
When writing the macro, you need to incorporate the following rules,
The die is numbered between 1 to 6 and each number indicates how many steps the player can
move. This number is randomly sampled between the given range i.e 1 to 6.
Whenever the player steps on a ‘yellow’ box, the player will be thrown back N number of steps
backwards. In this board game, there are 5 yellow boxes and they are positioned in cell G5, I5, U5,
AF5 and AM5 (see figure above).
Similarly, if the player steps on a ‘blue’ box, the player will be rewarded 3 free steps forward. In
this board game, there are two blue boxes only and they are positioned in cell N5 and Z5 (see
figure above).
Once the player crosses the finish line, use the MessageBox to display a message “FINISH!” with
the number of dice the player rolled.
Finally, assign your macro to a ‘Button’ and test whether it works or not.