Dear Mr Excel,
I have created a password activated spreadsheet, but I cannot find how to 'Mask' the characters of the password box, does anyone know how to help?
I have created the code below;
Sub Run_Password_Admin_Macro()
'Password protect for Admin
Dim strPassTry As String
Dim strPassword As String
Dim lTries As Long
Dim bSuccess As Boolean
strPassword = "Password123"
For lTries = 1 To 3
strPassTry = InputBox("Enter Password please", "RUN MACRO")
If strPassTry = vbNullString Then Exit Sub
bSuccess = strPassword = strPassTry
If bSuccess = True Then Exit For
MsgBox "Password incorrect"
Next lTries
If bSuccess = True Then Run "Unhide_Admin_sheets"
MsgBox "Welcome"
This works great, but i would like the characters to show ****** in the input box. I have found some information on line but I am not sure how to input into my code, the code below refers;
Dim strPasswd As String
Dim strAsterisks As String
Sub tbxPassword_Change()
strAsterisks = strAsterisks & "*"
strPassword = strPassword & Right(tbxPassword.Txt, 1)
tbxPassword.Txt = Asterisks
End Sub
Sub CommandButton_click()
PasswordChecker strPasswd
Unload Me
End Sub
Is it possible?
Thank you
Ben
I have created a password activated spreadsheet, but I cannot find how to 'Mask' the characters of the password box, does anyone know how to help?
I have created the code below;
Sub Run_Password_Admin_Macro()
'Password protect for Admin
Dim strPassTry As String
Dim strPassword As String
Dim lTries As Long
Dim bSuccess As Boolean
strPassword = "Password123"
For lTries = 1 To 3
strPassTry = InputBox("Enter Password please", "RUN MACRO")
If strPassTry = vbNullString Then Exit Sub
bSuccess = strPassword = strPassTry
If bSuccess = True Then Exit For
MsgBox "Password incorrect"
Next lTries
If bSuccess = True Then Run "Unhide_Admin_sheets"
MsgBox "Welcome"
This works great, but i would like the characters to show ****** in the input box. I have found some information on line but I am not sure how to input into my code, the code below refers;
Dim strPasswd As String
Dim strAsterisks As String
Sub tbxPassword_Change()
strAsterisks = strAsterisks & "*"
strPassword = strPassword & Right(tbxPassword.Txt, 1)
tbxPassword.Txt = Asterisks
End Sub
Sub CommandButton_click()
PasswordChecker strPasswd
Unload Me
End Sub
Is it possible?
Thank you
Ben