V
vicky
i need a code to store password to multiple sheets and to retain that
passwords when i closed the workbook. according to my code it can
assigns a password but cannot retain the multiple passwords assigned
to multiple sheet .
Sub ProtectAll()
Pwd = InputBox("Enter your password to protect all worksheets")
If Pwd <> "" Then
FormobjWSht_Input.Protect Password:=Pwd
Else
Exit Sub
End If
End Sub
Sub UnProtectAll()
'Dim Pwd As String
Pwd = InputBox("Enter your password to unprotect all worksheets",
"Password Input")
If Pwd <> "" Then
On Error Resume Next
FormobjWSht_Input.Unprotect Password:=Pwd
If Err <> 0 Then
MsgBox "You have entered an incorrect password. Worksheets could not "
& _
"be unprotected.", vbCritical, "Incorrect Password"
End If
passwords when i closed the workbook. according to my code it can
assigns a password but cannot retain the multiple passwords assigned
to multiple sheet .
Sub ProtectAll()
Pwd = InputBox("Enter your password to protect all worksheets")
If Pwd <> "" Then
FormobjWSht_Input.Protect Password:=Pwd
Else
Exit Sub
End If
End Sub
Sub UnProtectAll()
'Dim Pwd As String
Pwd = InputBox("Enter your password to unprotect all worksheets",
"Password Input")
If Pwd <> "" Then
On Error Resume Next
FormobjWSht_Input.Unprotect Password:=Pwd
If Err <> 0 Then
MsgBox "You have entered an incorrect password. Worksheets could not "
& _
"be unprotected.", vbCritical, "Incorrect Password"
End If