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

ReneRene
Change my mind. I dare you.
Chat with Rene
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
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