MissingInAction
Board Regular
- Joined
- Sep 20, 2019
- Messages
- 85
- Office Version
- 365
- Platform
- Windows
Good day everyone. I'm looking for VBA code that would lock a cell based on whether a check box has a tick in it, or not.
I have linked the check box to block G58. This block displays TRUE when the box is ticked. I then want block D59 to be unlocked if G58 is true and locked if G58 is false. I have tried the following code, but it does nothing:
E55 has a yes/no dropdown where the employee must select "yes" in order for the tick box to appear, which is why I used the if Target.Address code.
Thank you in advance.
I have linked the check box to block G58. This block displays TRUE when the box is ticked. I then want block D59 to be unlocked if G58 is true and locked if G58 is false. I have tried the following code, but it does nothing:
VBA Code:
If Target.Address = "$E$55" Then
If ActiveSheet.Range("G58").Value = True Then
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Range("D59").Select
Selection.Locked = False
Selection.FormulaHidden = False
Else
ActiveSheet.Unprotect
Application.ScreenUpdating = False
Range("D59").Select
Selection.Locked = True
Selection.FormulaHidden = False
End If
End If
E55 has a yes/no dropdown where the employee must select "yes" in order for the tick box to appear, which is why I used the if Target.Address code.
Thank you in advance.