Hi, I have the below code but when I share workbook it does't work.. any help pls
Sub UnP()
Dim wks As Worksheet
Dim strPassword
strPassword = InputBox("Enter the password", "Password")
ActiveSheet.Unprotect Password:=strPassword
Range("A4:I1000").Select
Selection.Locked = False
ActiveSheet.Protect contents:=False
ActiveSheet.Protect Password:=ActiveSheet.Range("P1").Value
Application.Goto Reference:="R4C1"
Selection.End(xlDown).Select
On Error GoTo 0
End Sub
Sub UnP()
Dim wks As Worksheet
Dim strPassword
strPassword = InputBox("Enter the password", "Password")
ActiveSheet.Unprotect Password:=strPassword
Range("A4:I1000").Select
Selection.Locked = False
ActiveSheet.Protect contents:=False
ActiveSheet.Protect Password:=ActiveSheet.Range("P1").Value
Application.Goto Reference:="R4C1"
Selection.End(xlDown).Select
On Error GoTo 0
End Sub