I have a spreadsheet that is protected, leaving only specific cells unlocked for users to edit.
I want to lock a range within the sheet if the value of B7 is greater than 34.
Based upon thread68-1318817: Locking cells with VBA I tried the following routine:
Private Sub Small_Group_supplement()
If [B7] > 34 Then
Range("b42:i42").Locked = True
Else
Range("b42:i42").Locked = False
End If
End Sub
When I protect the sheet again nothing appears to happen. I assume I am missing something. Can anyone enlighten me?
Many thanks in advance.
I want to lock a range within the sheet if the value of B7 is greater than 34.
Based upon thread68-1318817: Locking cells with VBA I tried the following routine:
Private Sub Small_Group_supplement()
If [B7] > 34 Then
Range("b42:i42").Locked = True
Else
Range("b42:i42").Locked = False
End If
End Sub
When I protect the sheet again nothing appears to happen. I assume I am missing something. Can anyone enlighten me?
Many thanks in advance.