Dim X, Y, strPW
If myLenght = 0 Then
'Random lenght [6-20]
Randomize
myLenght = Int((20 * Rnd) + 6)
End If
For X = 1 To myLenght
Y = Int((3 * Rnd) + 1) 'Numeric (1), upper (2) or lower (3) case alphabet
Select Case Y
Case 1
'Numeric character
Randomize
strPW = strPW & CHR(Int((9 * Rnd) + 48))
Case 2
'Uppercase character
Randomize
strPW = strPW & CHR(Int((25 * Rnd) + 65))
Case 3
'Lowercase character
Randomize
strPW = strPW & CHR(Int((25 * Rnd) + 97))
End Select
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.