Quote:
Public Function Gen_Rand_Password(PassLength As Integer) As String
Dim RetVal As String
Dim Max As Integer
Dim Min As Integer
Max = 126
Min = 48
Randomize Timer
If PassLength < 8 Then
Gen_Rand_Password = "error: invalid length"
End If
For I = 1 To PassLength
RetVal = RetVal & Chr(Int((Max - Min + 1) * Rnd + Min))
Next I
Gen_Rand_Password = RetVal
End Function
RandomPassword = Gen_Rand_Password(8)
|
Code is set to the standard length of eight. Shoot me a PM if you're unable to apply.
If your not 100% with you "for loops" then look at this tutorial:
http://www.youtube.com/watch?v=aM_5FWRk23c
It's fairly basic but you get the idea.