Try this
Code:Sub LockCells() Const strPWD As String = "Password" If strPWD = InputBox("Enter password to protect", "Protect sheets") Then With Worksheets("Group") .Unprotect strPWD .Cells.Locked = True .Range("C21:L21,C32:M36").Locked = False .Protect strPWD End With With Worksheets("Team") .Unprotect strPWD .Cells.Locked = True .Range("C4").Locked = False .Protect strPWD End With End If End Sub




Reply With Quote
Bookmarks