• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Unable to put check mark in 2nd box, if Sheet is protected.

Frncis

Member
I have 2 check boxes in cell range G4:G10, G13:G17. If the sheet is protected, I can check 1 box, but not the other. I checked the properties of the boxes, & it didn't matter if the box was protected or not. If the sheet is not protected, it works as expected. Could you please look at my sample, & explain what is wrong, & a solution.
 

Attachments

  • 1sheetsample.xlsm
    322.4 KB · Views: 1
I don't see checkboxes in column G, but pairs of checkboxes in column F which seem to be fine, but of those pairs of the checkboxes in column H, the right hand ones are all linked to cells in column V of the same row, but those cells are locked when the sheet is protected. When someone clicks one of those checkboxes it tries to change the value in column V but can't. You need to unlock those cells in column V (or write a convoluted macro to do something similar, or remove the checkboxes links to cells).
 
@p45cal Thank you. That was the problem. I unprotected the cells & wrote code to protect them & allow changes. Here is the code that is located on the worksheet:
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
'This code prevents modification or deletion of cells in the range below.
        If Intersect(Target, Range("A2:O3,A4:A17,B11:P12,B33:L50,B59:B60,C32:J32,D4:D17,E18:F19,E20,F21:F22,F59:N60,G18,G20:G22,H18:I18,W2:X3,W4:W10,W13:W17,AW1")) Is Nothing Then Exit Sub
        On Error GoTo ExitPoint
        Application.EnableEvents = False
        If Not IsDate(Target(1)) Then
           Application.Undo
                        MsgBox " You can't delete or modify cell contents in this range " _
            , vbCritical, "Vocational Services - OVR   " & ActiveSheet.Name
            Application.Speech.Speak "You can't delete  or   modify cell contents  in this range. It is  locked.", SpeakAsync:=True
        End If
ExitPoint:
    Application.EnableEvents = True
 
End Sub
I knew it was something simple. I totally forgot about those cells being protected. W2:X3,W4:W10 are the cells that we are talking about.
 
Back
Top