Can't do it with InputBox. You need a UserForm:
Put two text boxes in user form (textbox 1 and textbox2).
Add 2 buttons: one for Log in, another for Cancel
Set the password textbox PaswordChar property to some characters (i.e. *) which will mask the user's password.
The Log in name is stored in Sheet1 column A and the password in Column B.
Hide Sheet1 so that user will not be able to see this.
Code:
Private Sub CommandButton1_Click()
If TextBox1 = "" Then GoTo LogErr
Set LogName = Sheet1.Range("A1:a65536").Find(TextBox1)
If Not LogName Is Nothing Then
If Sheet1.Range("A1:a65536").Find(TextBox1).Offset(0, 1) = TextBox2 Then
MsgBox "Welcome " & TextBox1
'do something
Me.Hide
Exit Sub
End If
End If
LogErr:
MsgBox "Log in error" & Chr(13), vbCritical, "Log in Failed"
End Sub
Private Sub CommandButton2_Click()
Me.Hide
End Sub