Private
Sub
Workbook_SheetChange(
ByVal
Sh
As
Object
,
ByVal
TARGET
As
Excel.Range)
Dim
ws
As
Worksheet
Dim
Blattname
As
String
For
i = 7
To
39
If
TARGET.Address =
"$I$"
& i
And
IsEmpty(TARGET) =
True
Then
Range(
"I"
& i).
Select
ActiveCell.FormulaR1C1 =
"=(HOUR(RC[-3])*60+MINUTE(RC[-3]))/60"
Selection.Font.Bold =
False
ElseIf
TARGET.Address =
"$I$"
& i
And
IsEmpty(TARGET) =
False
Then
Selection.Font.Bold =
True
End
If
Next
i
For
j = 7
To
39
If
TARGET.Address =
"$J$"
& j
And
IsEmpty(TARGET) =
True
Then
Range(
"J"
& j).
Select
ActiveCell.FormulaR1C1 =
"=(HOUR(RC[-3])*60+MINUTE(RC[-3]))/60/4"
Selection.Font.Bold =
False
ElseIf
TARGET.Address =
"$J$"
& j
And
IsEmpty(TARGET) =
False
Then
Selection.Font.Bold =
True
End
If
Next
j
For
t = 7
To
39
Blattname = ActiveSheet.Name
If
TARGET.Address =
"$T$"
& t
And
IsEmpty(TARGET) =
True
Then
Range(
"T"
& t).
Select
ActiveCell.FormulaR1C1 =
"=IF(RC[-9]>0,0.0001,(RC[-5]-RC[-6])*24)"
For
Each
ws
In
Sheets(Array(Blattname))
ws.Unprotect Password:=
"peterpan"
ws.Range(
"T7:T39"
).Locked =
False
Selection.Font.Bold =
False
ws.Range(
"T7:T39"
).Locked =
True
ws.Protect Password:=
"peterpan"
Next
ElseIf
TARGET.Address =
"$T$"
& t
And
IsEmpty(TARGET) =
False
Then
For
Each
ws
In
Sheets(Array(Blattname))
ws.Unprotect Password:=
"peterpan"
ws.Range(
"T7:T39"
).Locked =
False
Selection.Font.Bold =
True
ws.Range(
"T7:T39"
).Locked =
True
ws.Protect Password:=
"peterpan"
Next
End
If
Next
t
End
Sub