Excel VBA Rnd Function

Facebooktwitterredditpinterestlinkedinmailby feather

VBA Rnd Function: The Rnd function in VBA returns a random number that is greater than or equal to (>=) 0 and is less than (<) 1.

Syntax

Parameter

Number (optional) –This parameter represents a numeric value.

It can take the following values:

< 0 (greater than 0) – It signifies the same random number on each call as the seed Number

= 0 (equal to 0) – It signifies the recently generated random number.

>0 (less than 0) – It signifies the next random number in the sequence

Return

This function returns a random number that is greater than or equal to (>=) 0 and is less than (<) 1.

Example 1

Output

0.280329287
0.914913654
4.93E-01
VBA Rnd Function

Example 2

Output

0.733894348144531

0.695270717144012

VBA Rnd Function
Facebooktwitterredditpinterestlinkedinmailby feather