First of all, you'll have to review forum rules because your last post do no comply with rule #3 asking you to use code tags to enclosed your codes.
Now, find below the answer to your question: In fact, you want the sheet to be protected all the time except for some cells that you want to unlock when the checkbox is checked. So here is the code to do that:
Sub CheckBox1_Click()
If ActiveSheet.CheckBoxes("Check Box 1") = xlOn Then
ActiveSheet.Unprotect
ActiveSheet.Range("a1") = True
Range("A3:A8").Select
Selection.Locked = True
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
Else
ActiveSheet.Unprotect
ActiveSheet.Range("a1") = False
Range("A3:A8").Select
Selection.Locked = False
Selection.FormulaHidden = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("A1").Select
End If
End Sub
In the attached file, you'll find a working workbook.
regards
Pierre
Bookmarks