answersLogoWhite

0

You can use this function:

Function Random(ByVal Lowerbound As Long, ByVal Upperbound As Long)

Randomize()

Random = Int(Rnd * Upperbound) + Lowerbound

End Function

And use it by using:

whatever.Text = Random(1, 1000)

This example gives a number between 1 and 1000.

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

BeauBeau
You're doing better than you think!
Chat with Beau
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
More answers

randomize() 'goes before random function random() 'generates random number from 0 to 1

User Avatar

Wiki User

15y ago
User Avatar

Add your answer:

Earn +20 pts
Q: How you can generate an random unique number in visual basic studio?
Write your answer...
Submit
Still have questions?
magnify glass
imp