Hallo,
ich glaube jetzt habe ich es richtig gemacht.
Ich habe eine VBA Programmierung die geändert werden müsste, und ich habe so gar keine Ahnung wie.
Und zwar soll es statt in der t-Spalte in der u-Spalte stattfinden. Die Excel-Formel hat sich geändert und zwar in: =WENN(K7>0;0,0001;(T7))
Und das ist die VBA-Programmierung:
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 'Normalschrift
ElseIf TARGET.Address = "$I$" & i And IsEmpty(TARGET) = False Then
Selection.Font.Bold = True 'Fettschrift
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 'Normalschrift
ElseIf TARGET.Address = "$J$" & j And IsEmpty(TARGET) = False Then
Selection.Font.Bold = True 'Fettschrift
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 'Normalschrift
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 'Fettschrift
ws.Range("T7:T39").Locked = True
ws.Protect Password:="peterpan"
Next
End If
Next t
End Sub
|