View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Random Password Generator

Public Function RandomPass()

s = ""
For i = 1 To Int(Rnd() * 6 + 6)
If Rnd() < 0.3 Then
s = s & Chr(Int(Rnd() * 26 + 65))
ElseIf Rnd() < 0.5 Then
s = s & Chr(Int(Rnd() * 26 + 97))
ElseIf Rnd() < 0.75 Then
s = s & CStr(Int(Rnd() * 10 + 1))
Else
s = s & Choose(Int(Rnd() * 10 + 1), "!", "#", _
"$", "%", "^", "*", "(", ")", "", "<")
End If
Next
RandomPass = s
End Function


? randompass()
TusX10%u9c
2ifP75
muSH3DhZzP4
8uleI109
qJmpafP
cNAwe4

--
Regards,
Tom Ogilvy

"USCBrad" wrote:

I am looking for a random generator that will give me anywhere between 6 to
12 characters (alphanumeric) that we can use as temp passwords. Can someone
give me direction as to what the code would be or where to find it. Please
email me at