View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pierre via OfficeKB.com[_2_] Pierre via OfficeKB.com[_2_] is offline
external usenet poster
 
Posts: 122
Default generating passwords question

Hi,

I have the following code to generate random passwords:

Sub passgen()
Dim k As Long
With Sheets(Licentie)

For k = 1 To 6
For a = 1 To 1000
X = Int(Rnd * 2)
If X = 1 Then
Cells(a, k) = Chr(Int(26 * Rnd) + 65)
Else
Cells(a, k) = Int(9 * Rnd)
End If
Next a
Next k
End With
End Sub

The code puts random numbers and figures in column 1-6.
in column 7 i put the values of column 1-6 together to get a password.
However, the passwords are not unique...
How can i make the passwords unique?
Thanks,
Pierre


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200511/1