How to generate numbers in vb randomly

Asked By 190 points N/A Posted on -
qa-featured

Please tell me how to generate numbers in vb in random order. I am using the 2008 version of vb. I want to create random numbers for making client numbers. How can I do this?

SHARE
Answered By 0 points N/A #163525

How to generate numbers in vb randomly

qa-featured

 

Hi Heather Carr,

Rnd Function

Every time the Rnd function is used, a novel pseudo-random value is revisit. The values returned are constantly less than one (1), but greater than or equal to zero (0). That is to state, VB produces random numbers which may be as low as zero (0), but will never attain the value of one (1). 
0 = Rnd 1

The values in that series may not appear very helpful but there's an easy formula for exchange the values returned by Rnd into a more useful range: 
Int((HighestValue – LowestValue + 1) * Rnd) + LowestValue
Initiate a function that summarizes this formula will aid abridge the generation of pseudo-random values. 

Thanks

 

Related Questions