omagoodness
Board Regular
- Joined
- Apr 17, 2016
- Messages
- 67
I am creating a game board where I want to generate a random response to a listBox selection. My list box displays a list of categories. The player selects a category and I want Excel to select a random word/name etc. from a correcsponding list. For example, one list item is "The Oscars". I have a list with the names of 10 Oscar winners and I want excel to randomly select from the list of 10 names. In the sheet, I can accomplish this with the formula
.
I have a user form for player interaction where the player selects from a list of 10 categories. Each category has a correcpsonding table of data and I have created variables for each list. I want to use VBA to make the random selection, but I cannot figure out how to translate the above formula to vba code. Can anyone help?
Excel Formula:
=INDEX(Lists!H17:H27,RANDBETWEEN(1,10))
I have a user form for player interaction where the player selects from a list of 10 categories. Each category has a correcpsonding table of data and I have created variables for each list. I want to use VBA to make the random selection, but I cannot figure out how to translate the above formula to vba code. Can anyone help?