Hi all,
I'm currently creating a simple Excel form which will be circulated to about 100 people to be filled out. I have password protected it (for the sake of the argument, password is 1). Cell C40 contains a Form Control (not ActiveX) Option Box with just Yes or No. They are linked to cell L40, which returns the values 1 for 'Yes' and 2 for 'No'. What I need to do is, when someone chooses 'Yes', therefore cell L40 = 1, for cell D40 to be unlocked, for a person to enter the reason for the Yes. I've created the following code but it's not working:
Could you please give me some light?!
Thank you very much.
I'm currently creating a simple Excel form which will be circulated to about 100 people to be filled out. I have password protected it (for the sake of the argument, password is 1). Cell C40 contains a Form Control (not ActiveX) Option Box with just Yes or No. They are linked to cell L40, which returns the values 1 for 'Yes' and 2 for 'No'. What I need to do is, when someone chooses 'Yes', therefore cell L40 = 1, for cell D40 to be unlocked, for a person to enter the reason for the Yes. I've created the following code but it's not working:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("L40") = "1" Then
ActiveSheet.Unprotect Password:="1"
Range("D40").Locked = False
Range("D40").Select
ActiveSheet.Protect Password:="1"
Else
ActiveSheet.Protect Password:="1"
Sheets("Sheet1").Range("D40").Locked = True
End If
End Sub
Could you please give me some light?!
Thank you very much.
Last edited by a moderator: