Private Sub Worksheet_Change(ByVal Target As Range) Dim tbl As ListObject
Set tbl = Worksheets("Nursery").ListObjects("TableName")
If Not Intersect(Target, tbl.ListColumns("Bus Discount").Range) Is Nothing Then
Dim CellBusDiscount As Range
[COLOR=Blue]Unprotect Password:="Secret"
[/COLOR]
For Each CellBusDiscount In Intersect(Target, tbl.ListColumns("Bus Discount").Range)
Select Case CellBusDiscount.Value
Case "Yes"
CellBusDiscount.Offset(0, Application.Worksheet.Function.Match("Bus Reason", tbl.HeaderRowRange, 0) - Application.WorksheetFunction.Match("Bus Discount", tbl.HeaderRowRange, 0)).Locked = False 'Column E
CellBusDiscount.Offset(0, Application.Worksheet.Function.Match("Bus Discount Amt", tbl.HeaderRowRange, 0) - Application.WorksheetFunction.Match("Bus Discount", tbl.HeaderRowRange, 0)).Locked = False
Case "No"
CellBusDiscount.Offset(0, Application.Worksheet.Function.Match("Bus Reason", tbl.HeaderRowRange, 0) - Application.WorksheetFunction.Match("Bus Discount", tbl.HeaderRowRange, 0)).Locked = True
CellBusDiscount.Offset(0, Application.Worksheet.Function.Match("Bus Discount Amt", tbl.HeaderRowRange, 0) - Application.WorksheetFunction.Match("Bus Discount", tbl.HeaderRowRange, 0)).Locked = True
Case Else
CellBusDiscount.Offset(0, Application.Worksheet.Function.Match("Bus Reason", tbl.HeaderRowRange, 0) - Application.WorksheetFunction.Match("Bus Discount", tbl.HeaderRowRange, 0)).Locked = True
CellBusDiscount.Offset(0, Application.Worksheet.Function.Match("Bus Discount Amt", tbl.HeaderRowRange, 0) - Application.WorksheetFunction.Match("Bus Discount", tbl.HeaderRowRange, 0)).Locked = True
End Select
Next cell
[COLOR=Blue]Protect Password:="Secret"[/COLOR]
End If
End Sub