Random gen

  • Thread starter Thread starter pauluk
  • Start date Start date
P

pauluk

hi all,

ok what am looking to do is create a random unique id from a set lis
of characters the characters range A1:A37 the length of the id i
shortest 5 and longest 12

Thanks in advanc
 
What do you want to compare it against to check that it is unique?
 
Why not divide up your values to correspond to the date and time or think up
an algorithm that would generate an id based on the date and time. Then you
would be sure it is unique.
 
the value is to placed in column B so thats were it would compare

First id in cell B1

then when it creates the next one which will be b2 it compares firs
with range B:
 
or create a GUID for each item, bit long, but un ique.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Tom Ogilvy said:
Why not divide up your values to correspond to the date and time or think up
an algorithm that would generate an id based on the date and time. Then you
would be sure it is unique.
 
i just need to knwo how to generate id form ath range.

I can check for duplicates another wa
 
Paul,

here is one way to get a unique id by a column

=RANK(E1,$E$1:$E$10)+COUNTIF(E1:$E$1,E1)-1

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
See the Excel/Tutorials/Random Selection page of my web site for a
bunch of different methods.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions
 
What i want is this

i want to generate a random word or name from

a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9,0,
 
Public Function rndString$()
Const ALPHNUM = "abcdefghijklmnopqrstuvwxyz1234567890"
Dim pos%, i%, res$
For i% = 1 To 12
If i% < 6 Or Rnd() < 0.5 Then
pos% = 27 * Rnd() + 1
res$ = res$ & Mid$(ALPHNUM, pos%, 1)
End If
Next i%
rndString = res$
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top