ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Random Number Questions (https://www.excelbanter.com/excel-worksheet-functions/8657-random-number-questions.html)

Greegan

Random Number Questions
 
I hope my explanation below makes sense and that someone will be able to
help me out.

I want to have a worksheet that chooses a random number. The thing is, this
number represents a particular "playing card". This is for a board game my
friends and I have decided to try online...
So this playing card is repeated 5 times in a deck of 40.
What I would like to do is have numbers 1-5 represent the same playing card,
6-10 another, and so on.
I want to click a button on the worksheet, have it generate the number,
which draws the card and then not have that number repeat itself until I
"shuffle" or reset the deck with another button.
Now I have seen how the random number can be generated, and if I'm correct
the number will randomly select another number if a field is double-clicked
or F9(?) is selected...
I want to avoid the double click and F9. I would like to have it choose that
"playing card" and be able to continue with the "drawing" of cards until
they are all used or I reset the deck.

Could anyone assist me with this?

Much appreciated.

G



Dave Peterson

I'm not quite sure how you populate your range (or when), but you may want to
look at JE McGimpsey's routine for non-duplicated random numbers.

You can find it he

http://www.mcgimpsey.com/excel/udfs/randint.html



Greegan wrote:

I hope my explanation below makes sense and that someone will be able to
help me out.

I want to have a worksheet that chooses a random number. The thing is, this
number represents a particular "playing card". This is for a board game my
friends and I have decided to try online...
So this playing card is repeated 5 times in a deck of 40.
What I would like to do is have numbers 1-5 represent the same playing card,
6-10 another, and so on.
I want to click a button on the worksheet, have it generate the number,
which draws the card and then not have that number repeat itself until I
"shuffle" or reset the deck with another button.
Now I have seen how the random number can be generated, and if I'm correct
the number will randomly select another number if a field is double-clicked
or F9(?) is selected...
I want to avoid the double click and F9. I would like to have it choose that
"playing card" and be able to continue with the "drawing" of cards until
they are all used or I reset the deck.

Could anyone assist me with this?

Much appreciated.

G


--

Dave Peterson


All times are GMT +1. The time now is 12:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com