Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Rnd always gives the same values

Status
Not open for further replies.

PJfan

Technical User
Sep 27, 2002
2
US
I have created a VBA program that gernerates a random number for me. I have this program looping, and if I tell it I want it to generate ten sets of ten different random numbers, it will do it. But if I ask it to generate ten different sets of ten different random numbers, these ten sets will be the same as the ten sets from the first time I asked it to generate them. Does anyone know why this will happen? Thanks for your help.

Jeremy I'm Thumbing my way back to Heaven.
 
Did you call Randomize first.

"Before calling Rnd, use the Randomize statement without an argument to initialize the random-number generator with a seed based on the system timer." Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top