Generating Passwords in Cells

G

Guest

I found an old post that I was able to modify, but I still have a couple
questions. Here is a copy/paste of what I posted to the old post from January:
-----------------------------------------------------------------------------

I too was looking for a way to create passwords and came across this post. I
am not trying to look across different worksheets, which makes it easier. I
have the person's last name in Column C and the Passwords will go in Column
D. I have a header row, so my data starts on Row 2. It works nicely except I
have a few questions,

1) The current code takes the last value from Column C and places it in
Column D, Row 2. This is not correct. It should take the value from Column C,
Row 2 and concatenate it as it does with the rest of the cells. How do I make
it do that?

2) Is there a way to scramble "C2"? For example, if a person's last name is
"Smith", it generates the following password: "&pSmith!V". I would rather it
scramble the "Smith" part of the password. So it might read for example,
"&phSimt!V". Is this possible?

3) As far as scrambling goes, is it possible to just create a random
character password not based on another cell value? If so, that would be the
best solution.

Here's the code I modified from the earlier post:
----------------------------------------------------------------

Sub Password()
Dim Cell As Range

For Each Cell In Range(Range("c2"), Range("c2").End(xlDown))
Cell.Offset(0, 1).Value = MakeNewPassword(Cell.Value)
Next

End Sub

Private Function MakeNewPassword(UserName As String) As String
Dim pass1 As String

'Using C1 to hold the UserName
With Sheets("Phase_1")
.Range("d2").Value = UserName
pass1 = .Range("d2")
MakeNewPassword = "&p" & pass1 & "!V"

End With

End Function
 
G

Guest

I failed to mention what I'm looking for in a password. The rules would be:
1) 8 characters/numbers mixed
2) Upper and Lower case characters
3) Include at least 1 number
4) Special characters 1-0 are okay.

Thanks for any help,

Sharon
 
G

Guest

I failed to mention what I'm looking for in a password. The rules would be:
1) 8 characters/numbers mixed
2) Upper and Lower case characters
3) Include at least 1 number
4) Special characters 1-0 are okay.

Thanks for any help,

Sharon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top