Mustafa Evans
New Member
- Joined
- Mar 18, 2010
- Messages
- 35
- Office Version
- 2010
- Platform
- Windows
Have never used VBA before. And I found this code online.
It seems to allow me to lock cells dependent on a value in Cell A1.
I need the following to happen. If A1 is Routine then A2 is locked and the cell greyed out. And A3 and A4 is allowed to be edited and data entered.
However if A1 is Urgent cell A2 is unlocked and A3 and A4 and locked and greyed out.
If course I want this to occur throughout column A. Can anyone help. Thanks
Private Sub Worksheet_Change(ByVal Target As Range) If Range("A1") = "Routine" Then Range("A3:A4").Locked = FALSE ElseIf Range("A1") = "Urgent" Then Range("A3:A4").Locked = True End If End Sub |
It seems to allow me to lock cells dependent on a value in Cell A1.
I need the following to happen. If A1 is Routine then A2 is locked and the cell greyed out. And A3 and A4 is allowed to be edited and data entered.
However if A1 is Urgent cell A2 is unlocked and A3 and A4 and locked and greyed out.
If course I want this to occur throughout column A. Can anyone help. Thanks