I am facing Excel 2013 crash issues while using a VBA script to lock/unlock cell based on other cell value. Could you help me to find out the error/mistake in my VBA code!
Private Sub Worksheet_Change(ByVal Target As Range)
Unprotect "****"
On Error Resume Next
If [S9] = "Yes" Then
Unprotect "****"
[T9].Locked = False
Protect "****"
Else
Unprotect "****"
[T9].Locked = True
[T9].ClearContents
Protect "****"
End If
If [S11] = "Yes" Then
Unprotect "****"
[T11].Locked = False
Protect "****"
Else
Unprotect "****"
[T11].Locked = True
[T11].ClearContents
Protect "****"
End If
Protect "****"
End Sub