Random number generation

Shivani R shivani.shivipr at gmail.com
Fri Apr 9 02:11:38 UTC 2010


Hi,

I am working on an experiment in which I want to generate 100 random
numbers between 1 - 100, but a number should not be repeated. Say if 1
is generated then it should not be generated again. Basically I want
all 100 numbers between 1 and 100 without any repetetion and that too
in a random manner.

Right now I am using the script

Dim i as Integer
Dim Rand as Integer

For i = 1 to 100

Rand = Random(1,100)

Debug.Print "Random number is = " & Rand

Next i



This is giving me random numbers between 1 and 100, but the numbers
are repeated.

Please let me know if there is any logic of generating random numbers
without any repeat.

Any help is really appreciated.


Regards
Shivani

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list