Option
Explicit
Private
Sub
Workbook_Open()
ActiveWorkbook.Unprotect Password:=
"xyz"
Dim
Blatt
As
Worksheet
For
Each
Blatt
In
ActiveWorkbook.Worksheets
Blatt.Visible =
True
Blatt.Unprotect Password:=
"xyz"
Blatt.Shapes(
"CheckBox1"
).Visible =
Not
Blatt.Range(
"P4"
) =
"Wahr"
Range(
"B6"
).
Select
Blatt.Protect Password:=
"xyz"
Next
Blatt
Dim
wks
For
Each
wks
In
Me
.Sheets
If
wks.Name <> Format(
Date
,
"dd"
)
Then
wks.Visible =
False
Next
If
Format(
Date
- 1,
"dd"
) <>
"31"
Then
Sheets(Format(
Date
- 1,
"dd"
)).Visible =
True
If
Format(
Date
+ 1,
"dd"
) <>
"01"
Then
Sheets(Format(
Date
+ 1,
"dd"
)).Visible =
True
If
Range(
"P6"
) <> Range(
"P7"
)
Then
Call
alle_Tage
Sheets(
"01"
).Activate
End
If
ActiveWorkbook.Protect Password:=
"xyz"
MsgBox
"Willkommen zurück "
End
Sub