ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Random Password Generator (https://www.excelbanter.com/excel-programming/362316-random-password-generator.html)

USCBrad

Random Password Generator
 
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

Tom Ogilvy

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



All times are GMT +1. The time now is 01:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com