There is a selection of five random digits that the “winning number.” The user should be able to buy as many tickets (each containing five random numbers) as they would like at $1 per ticket. If one of the user ticket matches the winning number, the user wins $100,000. Assuming that order matters, if the winning number is 21345, then 12345 doesn’t win.)
I am trying to write a sub that will first, generates a random winning number, then stores it in a string variable so that you can use string concatenation, next it will asks the how many cards user wants to buy. It must then use a For Loop to generate this many cards and store their number in a card array which should be a string array. Next, it should use a DO LOOP to keep checking cards until a winner has been found or no more cards remain. Lastly, it must display a message saying whether you are a winner and what your net gain or loss. A single random digit from 0 to 9 can be generate with excel’s RandBetween Function.