Rnd Function

Syntax

Rnd([Num])

Group

Math

Description

Returns a random number greater than or equal to zero and less than one.

Parameters

Parameters Description
Num See the following table.

 

Num Description
<0 Returns the same number every time, using Num as the seed.
>0 Returns the next random number in the sequence.
0 Returns the most recently generated number.
omitted Returns the next random number in the sequence.

Example


Sub Main
    Debug.Print Rnd() ' 0.??????????????
End Sub

See also

Randomize