Function CalcOverTime(objSheet As Worksheet)
'sResults([Montag-Sonntag], [Kalenderwoche], [Datum], [Beginn Arbeitszeit], [Ende Arbeitszeit], [Beginn Pause], [Ende Pause]
Dim sResults(7, 1, 1, 1, 1, 1, 1) As String
Dim iWorkday As Integer
Dim iTotal As Integer
Dim iTotalWT As Integer
sResults = CollectTimeFromSheet(objSheet)
iTotalWT = Sheets("Index").Range("H6").Value 'Soll Arbeitszeit
For iWorkday = 0 To 7
iTotal = sResults(iWorkday, 0, 0, 0, 1, 0, 0) - sResults(iWorkday, 0, 0, 1, 0, 0, 0) 'Ende Arbeitszeit - Beginn Arbeitszeit
If (iTotal > iTotalWT) Then
MsgBox "Überstunde gefunden!"
End If
Next
End Function
Function GetOverTime()
Dim objSheets As Excel.Worksheet
For Each objSheets In Worksheets
CalcOverTime (objSheets)
Next
End Function
|