Private
Sub
CommandButton1_Click()
On
Error
Resume
Next
If
ActiveSheet.ProtectContents =
False
Then
GoTo
Fehler
ActiveSheet.Unprotect
Exit
Sub
Fehler:
ActiveSheet.Protect DrawingObjects:=
True
, Contents:=
True
, Scenarios:=
True
_
, AllowSorting:=
True
, AllowFiltering:=
True
, AllowFormattingColumns:=
True
, AllowFormattingCells:=
True
, AllowFormattingRows:=
True
, AllowInsertingColumns:=
True
, Password:=(
"KdoSAN"
)
End
Sub