S
Sharon
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
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