To Get repeat sequences of random numbers

Suppose if you want to test your application functionality with same repeated sequence of random number then use Rnd(-1)

here use Rnd argument number as -1

Script:

Dim MyValue, Response
Randomize   ‘ Initialize random-number generator.
Do Until Response = vbNo
MyValue = Int((9 * Rnd(-1)) + 1)   ‘ Generate random value between 1 and 9.
MsgBox MyValue
Response = MsgBox (“Is it same that prev value “, vbYesNo)
Loop

Advertisement
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.