1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Public Function Date_HourTakt(startDate As Double, taktValue As Double, startProduction As Double, endProduction As Double, Optional workingHolidays As Range) As Double
Application.Volatile
Dim tempValue, value As Double
Dim dateValue As Integer
Dim hourValue As Double
Dim closedInterval As Double
dateValue = Int(startDate)
hourValue = startDate - Int(startDate)
taktValue = taktValue / 24
closedInterval = 1 - (startProduction + endProduction)
tempValue = hourValue + taktValue
If tempValue > endProduction Then
tempValue = hourValue + closedInterval + taktValue
dateValue = dateValue + 1
End If
value = dateValue + tempValue
Date_HourTakt = value
End Function |
Partager