I have to create a table where the users will input:
Entry # / Date / Sample ID / Result 1 / Result 2
then excel runs the calculations.
I want to lock the columns for "Result 1" and "Result 2" when the users enter data in these specific columns and be able to protect the worksheet with a password.
I found the following code by Don, it works great to lock those specific columns but I can't figure out how to add a password.
Thanks for any help.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Or Target.Column = 5 And Target.Value <> "" Then
ActiveSheet.Protect contents:=False
Range(Target.Address).Locked = True
ActiveSheet.Protect contents:=True
End If
End Sub