473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

generate 10 digit unique number using VBA ?

Generate 10 digit unique number using VBA ?

I used the Unix -Time formula

Now the problem with this is 2 person from different computer can generate number at same sec then this will fail
Because the 10 digit unque number genrated by Unix time is the time difference between the present time and Unix eco time.
Sep 21 '10 #1
6 4812
code green
1,726 Expert 1GB
Do you want to use the unix timestamp or just a random number?
There is always Rnd() and custom random functions
Sep 21 '10 #2
I cant use Rnd() function because this does not guaranty me unique number whenever I generate a number.

I will tell u the scenario I have a doc whenever i open this a macro pop up to generate a unique 10 digit number . this doc may be on several machines anyone who uses this doc should get a unique number
Sep 22 '10 #3
Thank You for your response
Sep 22 '10 #4
code green
1,726 Expert 1GB
So it is unique rather than random.
You could get millisecond accuracy using the timer and the current time in seconds, not 100% guarantee of unique buts the odds of duplication must be huge.

The only true guarantee of a unique number is generating your own incremetal index
Sep 22 '10 #5
Please could help me to find milli sec in VBA
Sep 23 '10 #6
code green
1,726 Expert 1GB
It is a VB function timer()
Sep 23 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Joe Wong | last post by:
Hi, I need to implement a unique number generator that 1 or more processes on same or different machines will make use of it. Is there any library / project available already for this? Thanks...
3
by: Dixie | last post by:
I am trying to create a registration system in which a unique text string accessible in a table of the program is turned into a unique number which will be matched with a number sent to the...
2
by: Henry | last post by:
Hi, How can I generate an eight digit random? Can I use the staff name to generate it? May I ask is there any sample c# code to see? Thanks
4
by: David Dvali | last post by:
Hello. How can I generate some fixed length unique number (for example 6 character) based on some number like 1, 2, .. 45, 46, 47 (Generally I will use unique ID of the database record as base...
2
by: Chris Dunaway | last post by:
I have a web service which is accessed by a windows forms application. When the application submits a unit of work (a "job"), I want to return a job receipt or tracking number back to the...
9
by: Omatase | last post by:
I have a set of about 6 or so strings that I need to use to generate a unique hash. This hash will become the unique key in a database so the hash has to be the same each time I gen it for any 1...
8
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed....
13
by: gamernaveen | last post by:
I am coding a script , where basically the user has to enter his name , choose file , file comments if required and upload. The file comments , name , filename will be stored in the database with...
2
by: nickyazura | last post by:
Hi, I would like to ask you regarding creating file name by adding unique number where it can automatically generated Dim sFileE As String sFileE = ".csv" sFileName = "Weld_In_Record" &...
1
by: ramdil | last post by:
Hi All I have got a lots of help from this forum and again i am in need of yours help. I will briefly explain the scenario.I have a customer table.It was created 12 years ago and its Primary key...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.