megnin
Active Member
- Joined
- Feb 27, 2002
- Messages
- 340
I have a start time inserted into column A and an ending time inserted in column J using this:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 3 Then
Target.Offset(0, -2).Value = Now()
End If
If Target.Column = 6 Then
Target.Offset(0, 4).Value = Now()
End If
End Sub
Then in column k I have J2-A2 to calculate the elapsed time.
I need the elapsed time to not count hours after "working hours". So for instance start time is 10/24 at 4:00pm and end time is 10/25 at 9:00am elapsed time should be 2 hours assuming an 8-5 workday.
Is this possible?
Thanks in advance!!
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 3 Then
Target.Offset(0, -2).Value = Now()
End If
If Target.Column = 6 Then
Target.Offset(0, 4).Value = Now()
End If
End Sub
Then in column k I have J2-A2 to calculate the elapsed time.
I need the elapsed time to not count hours after "working hours". So for instance start time is 10/24 at 4:00pm and end time is 10/25 at 9:00am elapsed time should be 2 hours assuming an 8-5 workday.
Is this possible?
Thanks in advance!!