I am very new to VBA and I would very much appreciate support in this.
I am writing a simple code that asks a user to input a 'password'. The list of passwords are hard-coded in VBA. If the user inputs a password that matches what was hard-coded in VBA, then it will put it on cell 'B2', if it is wrong, then the user will get an error message that the password was wrong.
My code so far is:
Sub Password()
Dim Password As String
Dim Msg As String
Dim List(Password1, Password2) As String
Msg = "please enter password"
Password = InputBox(Msg)
If Password <> List Then
MsgBox "Incorrect Password!"
ActiveSheet.Range("B2").Value = Password
End Sub
I am not sure where I am going wrong?
Many thanks