Random gen

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
 
T

Tom Ogilvy

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.
 
P

pauluk

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:
 
B

Bob Phillips

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.
 
P

pauluk

i just need to knwo how to generate id form ath range.

I can check for duplicates another wa
 
B

Bob Phillips

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)
 
T

Tushar Mehta

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
 
P

pauluk

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,
 
S

Steve Garman

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
 
Top