I have a sheet that has column B. the states a disposition of our product released, hold ect.. column A. states what has been done with this product ie shipped, in storage ect. I need to have column A. to be locked if column B. is set to "Hold" I am pretty new to this coding and so I have almost no idea where to start or if its even possible.
Asked
Active
Viewed 24 times
-1
-
We need much more info from you. What do you mean locked? You say coding but I don't see any coding tags – urdearboy Mar 27 '19 at 21:25
-
Locked meaning unable to enter anything in the cell – William Morgan Mar 27 '19 at 21:30
-
https://stackoverflow.com/questions/45987196/possible-to-lock-range-of-cells-based-on-another-cells-value?rq=1 – Tim Williams Mar 27 '19 at 21:31
1 Answers
0
Pasted in VBE under sheet that you want this rule to apply to...
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
If Target.Count = 1 Then
If Target.Offset(, 1) = "Hold" Then
Application.EnableEvents = False
Application.Undo
MsgBox "Cell on Hold. Reverting changes", vbCritical
Application.EnableEvents = True
End If
End If
End If
End Sub

urdearboy
- 14,439
- 5
- 28
- 58