I need a little guidance. I do not want to use Data Validation to restrict data entry in the cells as the warnings for accidentally typing will decrease productivity. I want the user to be able to select from the list in the Table column C and it lock the unnecessary cells so they can quickly tab over the locked cells. I will need the code to function for each line in my table. I used my target range as ActiveSheet.ListObjects so it will also continue to work with the sheet is copied for the next month. I have also tried C3:C (my data does begin on line 3) as the target range and still cannot get it to work.
My drop box in the Column C (Table Column Header is Payment Type) has 3 possibilities
PDPM- should lock AE:AJ in each row if selected
RUGs IV- should lock AA:AD in each row
Levels- should lock AA:AJ
So frustrated!!!
My drop box in the Column C (Table Column Header is Payment Type) has 3 possibilities
PDPM- should lock AE:AJ in each row if selected
RUGs IV- should lock AA:AD in each row
Levels- should lock AA:AJ
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range(ActiveSheet.ListObjects(1).Name & "[[#All],[Payment Type]]")) Is Nothing Then Exit Sub
ActiveSheet.Unprotect Password:="Protection"
Select Case Target.Value
Case "PDPM"
Range("AE" & Target.Row & ":AJ" & Target.Row).Locked = True
Case "RUGs IV"
Range("AA" & Target.Row & ":AD" & Target.Row).Locked = True
Case "Levels"
Range("AA" & Target.Row & ":AJ" & Target.Row).Locked = True
Case Else
Range("AA" & Target.Row & ":AJ" & Target.Row).Locked = False
End Select
ActiveSheet.Protect Password:="Protection"
End Sub
So frustrated!!!