|
-
Jan 5th, 2011, 03:06 PM
#11
Thread Starter
Junior Member
Re: Random number generator - select concatentation method
 Originally Posted by opus
Try this:
Code:
Private Sub create_short_passwords(ByVal whole_user_answer)
Dim NewPassword As String
Select Case Int(Rnd(1) * 5) + 1
Case 1
NewPassword = Left$(whole_user_answer, 3) & Right$(whole_user_answer, 3)
Case 2
NewPassWord = Left$(whole_user_answer, 2) & Right$(whole_user_answer, 3)
Case 3
NewPassWord = Left$(whole_user_answer, 3) & Right$(whole_user_answer, 2)
Case4
NewPassWord = Left$(whole_user_answer, 2) & Right$(whole_user_answer, 3)
Case5
NewPassWord = Left$(whole_user_answer, 1) & Right$(whole_user_answer, 2)
End Select
MsgBox NewPassWord
End Sub
Note: You could easily put all password-creators in oner sub.
Got it. All working fine now . Thank you very much And i probably will put all the password generators in the one sub, but thats something I can do myself. Many thanks,
bainy
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|