Hello All
I am looking for some changes in below VBA code, where i need to have my password as mask i.e, ***** whenever i enter my password in the Input Box.
Request you to please provide the Code.
Sub sbProtectAllSheets()
Dim pwd1 As String, pwd2 As String
pwd1 = InputBox("Please Enter the password")
If pwd1 = "" Then Exit Sub
pwd2 = InputBox("Please re-enter the password")
If pwd2 = "" Then Exit Sub
'Check if both the passwords are identical
If InStr(1, pwd2, pwd1, 0) = 0 Or _
InStr(1, pwd1, pwd2, 0) = 0 Then
MsgBox "You entered different passwords. No action taken"
Exit Sub
End If
For Each ws In Worksheets
ws.Protect Password:=pwd1
Next
MsgBox "All sheets Protected."
Exit Sub
End Sub
Bookmarks