Here's the code in question:
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect
Range("B4:D4,I4:J4,B5:E5,G5:H5,J5,B6,E6:G6,I6:J6,C7:D7,F7:G7,B9:E9,I9:J9,B10:E10,G10:H10,J10,B11,E11:F11,H11:I11,B12:C12,E12,C14:E14,a56,b56,c56,d56,e56,f56,g56,h56,i56,j56").ClearContents
Range("G14:H14,J14,B15,B17,E17,G17:H17,B19,E19,G19:H19,J19,A23:H23,A24:H24,A25:H25,a26:h26,a27:h27,a28:h28,a29:h29,a30:h30,a31:h31,a32:i32,B34:F34,B35:F35,C47:J47,A48:J48,C49:J49,A50:J50,J53,J54").ClearContents
ActiveSheet.Protect
End Sub
getting a method error when I have the Activesheet.Protect/unprotect in code. I need to have the sheet locked and is there any othere way to have the code excute when the sheet is locked?
Thanks
Private Sub CommandButton1_Click()
ActiveSheet.Unprotect
Range("B4:D4,I4:J4,B5:E5,G5:H5,J5,B6,E6:G6,I6:J6,C7:D7,F7:G7,B9:E9,I9:J9,B10:E10,G10:H10,J10,B11,E11:F11,H11:I11,B12:C12,E12,C14:E14,a56,b56,c56,d56,e56,f56,g56,h56,i56,j56").ClearContents
Range("G14:H14,J14,B15,B17,E17,G17:H17,B19,E19,G19:H19,J19,A23:H23,A24:H24,A25:H25,a26:h26,a27:h27,a28:h28,a29:h29,a30:h30,a31:h31,a32:i32,B34:F34,B35:F35,C47:J47,A48:J48,C49:J49,A50:J50,J53,J54").ClearContents
ActiveSheet.Protect
End Sub
getting a method error when I have the Activesheet.Protect/unprotect in code. I need to have the sheet locked and is there any othere way to have the code excute when the sheet is locked?
Thanks