A solution to a similar question posted by Harlan Grove in the MS groups:_
"Glenn" wrote...
>I need to create random six digit passwords made up of letters and numbers.
>Is it possible to do this in excel?
FTHOI, here's an approach that doesn't require VBA. Define the following names
(Insert > Names > Define).
alphanum referring to
="a0b1c2d3ef4g5h6ij7k8l9mn0o1p2q3rs4t5u6vw7x8y9z"
password referring to
=MID(alphanum,INT(1+46*RAND()),1)&MID(alphanum,INT(1+46*RAND()),1)
&MID(alphanum,INT(1+46*RAND()),1)&MID(alphanum,INT(1+46*RAND()),1)
&MID(alphanum,INT(1+46*RAND()),1)&MID(alphanum,INT(1+46*RAND()),1)
Then the worksheet cell formula =password will give you different 6-char
passwords made up of decimal digits and letters.
You would just need 4 of them and not 6.
--------------------------------------
If you prefer a function route, then here's a routine posted in the MS NGs some time ago by a guy called. David
Higgs. Pass it the password length, and it returns the result
Function GetPW(iLen As Integer) As String
Dim i As Integer
For i = 1 To iLen
If Rnd > 0.5 Then
GetPW = GetPW & _
Chr(Int((Asc("9"

- Asc("0"

+ 1) * Rnd + Asc("0"

))
Else
GetPW = GetPW & _
Chr(Int((Asc("Z"

- Asc("A"

+ 1) * Rnd + Asc("A"

))
End If
Next i
End Function
You would put this into a module and then in any cell just type for example =getpw(4)
Regards
Ken................
----------------------------------------------------------------------------
![[peace] [peace] [peace]](/data/assets/smilies/peace.gif)
It's easier to beg forgiveness than ask permission
----------------------------------------------------------------------------