Private Sub Worksheet_Activate()
ActiveSheet.Protect "RS"
ActiveSheet.Range("B:C").Locked = False
End Sub
I am trying above code but not working, i want to unlock only B and C column
Private Sub Worksheet_Activate()
ActiveSheet.Protect "RS"
ActiveSheet.Range("B:C").Locked = False
End Sub
I am trying above code but not working, i want to unlock only B and C column
You are protecting the sheet before you unlock the range. But since the sheet is protected, the range cannot be unlocked. Swap the two lines and the code will work: