I can get it to work, but I have done a slight restructure of your table. I am guessing you have used the same code as me for inputting times (to avoid typing the colon all the time;
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim TimeStr As String
On Error GoTo EndMacro
If Application.Intersect(Target, Range("C2:L30")) Is Nothing Then
Exit Sub
End If
If Target.Cells.Count > 1 Then
Exit Sub
End If
If Target.Value = "" Then
Exit Sub
End If
Application.EnableEvents = False
With Target
If .HasFormula = False Then
Select Case Len(.Value)
Case 1 ' e.g., 1 = 00:01 AM
TimeStr = "00:0" & .Value
Case 2 ' e.g., 12 = 00:12 AM
TimeStr = "00:" & .Value
Case 3 ' e.g., 735 = 7:35 AM
TimeStr = Left(.Value, 1) & ":" & _
Right(.Value, 2)
Case 4 ' e.g., 1234 = 12:34
TimeStr = Left(.Value, 2) & ":" & _
Right(.Value, 2)
Case 5 ' e.g., 12345 = 1:23:45 NOT 12:03:45
TimeStr = Left(.Value, 1) & ":" & _
Mid(.Value, 2, 2) & ":" & Right(.Value, 2)
Case 6 ' e.g., 123456 = 12:34:56
TimeStr = Left(.Value, 2) & ":" & _
Mid(.Value, 3, 2) & ":" & Right(.Value, 2)
Case Else
Err.Raise 0
End Select
.Value = TimeValue(TimeStr)
End If
End With
Application.EnableEvents = True
Exit Sub
EndMacro:
MsgBox "You did not enter a valid time"
Application.EnableEvents = True
End Sub
I have moved the sub-totals (+/- 15/30 mins etc...) column to the end and adjusted the above code to cater for time input across the break in/out, lunch in/out times. I then totalled the amount of breaks (='break in - break out') and the same for time worked (='break out - break in')
So the layout I used is (sorry works laptop can't upload piccy)
Row 2 has the headings, Col A = Day, Col B = Date, Col C= Login Col D=Break out, Col E = break in, Col F= Lunch out, Col G= Lunch in etc... Col M is the total for breaks and Col N is the total for Time worked.
So in Col M I have =SUM(E3-D3)+(G3-F3)+(I3-H3)+(K3-J3)
and Col N I have =SUM(D3-C3)+(F3-E3)+(H3-G3)+(J3-I3)+(L3-K3)
If any time (in or out) is not filled you will get an ####### error, this can be worked around within the SUM formula.
If this is unclear, PM me and I will send you the file.
HTH
Colin