Sub Worksheet_Change(ByVal Target As Range)
If Intersect(target, Range("A1")) Is Nothing Then
Exit Sub
End If
If target.Value = "" Then
ActiveWorkbook.Protect _
Password:="aaa", _
structure:=True, _
Windows:=True
ActiveSheet.Protect _
Password:="aaa", _
DrawingObjects:=True, _
contents:=True, _
Scenarios:=True
Else
ActiveWorkbook.Unprotect _
Password:="aaa"
ActiveSheet.Unprotect _
Password:="aaa"
End If
End Sub