Reenter password using VBA
I am writing code on how to create a password within certain guidelines and then verify. I am having an issue with the verify part. Any advice would be great. This is the code I have so far
Sub Exercise12partB() Dim PassWord As String Dim NewPassword As Boolean Dim TryAgain As Boolean Dim i As Long Dim Verify As Boolean Do i = 1 PassWord = InputBox("Please create a Password. Must be 8 characters _ long, must start wtih an uppercase letter and mush consist only of uppercase _ letters and digits with no spaces", "") NewPassword = (Len(PassWord) = 8) And (Left(PassWord, 1) Like "[A-Z]" And i <= 7) If Not NewPassword Then If MsgBox("The password must be 8 characters in length, all characters to" _ & vbCrLf & "be UPPERCASE letters or digits, and must start with a letter." _ & String(2, vbCrLf) & "Would you like to try again?", vbYesNo, "") = vbYes Then TryAgain = True GoTo Loopagain Else TryAgain = False End If End If Loopagain: Loop While Not NewPassword And TryAgain If NewPassword Then MsgBox "You have Successfully created a new password" End If End Sub
Redo