answersLogoWhite

0


Best Answer

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

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

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

This answer is:
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
Related questions

How do you check whether the number is unique number?

There are several ways to either confirm that a given number is unique, or confirm that it is a duplicate of some number already on a list.Unique on a short list1) Compare the given number to each and every number on the list, one at a time, to see if the given number is already on the list. This is the best method for a short list of numbers.Unique on a long list2) If you are building a very long list of numbers, and you want to make sure that every number on the list is unique, sort the initial list of numbers and then do a binary search to see if the given number is already on the list. If it's not already there, then insert the new number in the appropriate place that keeps the list sorted.3) If you already have a very long list of numbers, and you want to see if each and every number on that list is unique, sort the list and then scan the sorted list for duplicates (which will be consecutive). This is quick and easy to do with the "sort" and "uniq" command-line tools.To generate a new list that only has the *unique* items in the original list (if any item is duplicated, that item is entirely left out of the second list):cat in.txt | sort | uniq -u | tee uniques.txtTo generate a new list that lists only the *duplicated* items in the original list (but every item in the new list is unique in that new list, because it leaves out the second, third, etc. duplicates of the repeated items):cat in.txt | sort | uniq -d | tee duplicates.txtIf that command doesn't print out anything, you can be sure that every item in the original list was unique.To generate a new list that has both the *unique* items *and* the *duplicated* items -- i.e., *every* item in the original list exactly once (leaving out the second, third, etc. duplicates of repeated items), so every item in the new list is unique in that new list:cat in.txt | sort -u | tee uniquified.txtUniversally unique4) Sometimes you want a number that is globally unique, that no other human has ever seen before.It's not possible to directly compare some given number with every number that any human has ever seen before If someone gives you a number, it's usually not possible to check after-the-fact if this is a unique number that only you two have seen, or if that someone gave you a copy of some old number that has been well-known by dozens of other people for decades.However, it is possible to build a process that generates "new" numbers that are almost certainly unique, such that it is practically impossible that any human has ever seen it before.(Such processes often involve "/dev/random", hardware random number generators, cryptographically secure pseudorandom number generators, or some combination of them).Such processes are used to generate a universally unique identifier (UUID),such as a globally unique identifier (GUID).Generating such numbers is quick and easy to do with the "uuidgen" command-line tool (spelled "uuid_generate" on some systems).uuidgen | tee unique_number.txt


What are the 5 components that makes a BPO unique?

random work..i think..


What are some unique framing options for random pictures?

Some unique framing options for random pictures can include shape and material of the frame along with different color schemes. Some of the most unique framing options appear when one uses their imagination.


Is zero a unique number?

Every number is a unique number.


What is autonumber field in access?

Automatically stores a number that is one greater than the last number used. It is used to identify a record by acting as a Primary Key. A Primary Key is unique and cannot be left blank. Even if a number is deleted, that number will never be used again, ensuring that each record can be uniquely identified. You do not have to enter the value. It will automatically enter itself. You also cannot change it.


Your name is Melinda and you need help naming your photography studio something unique?

hi


What is the definition of the unique number in math?

unique number: The number 1 has only one factor. (It is therefore unique.)


What is a random variable?

A random variable is a function that assigns unique numerical values to all possible outcomes of a random experiment. A real valued function defined on a sample space of an experiment is also called random variable.


Is this statement true or falseThree given angle measures always generate a unique triangle?

false


Is this statement true or falseThree given side measures generate at most one unique triangle?

true


Which are the examples of unique numbers in maths?

Every number is unique, because if any number weren't unique, it would be exactly the same as another number, so the number that wasn't unique was just another way to write a different number.


What is the algorithm of generating unique random numbers like in mobile recharge coupons?

luhn algo