steve400243
Active Member
- Joined
- Sep 15, 2016
- Messages
- 429
- Office Version
- 365
- 2016
- Platform
- Windows
Hello, I use the below VBA code to generate working hours. I need it to subtract 1 hour from the total? Any thoughts?
Code:
Public Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
' Calculate working hours if start and finish are both present
For Each Cell In Target
If (Cell.Column = [M3].Column Or Cell.Column = [N3].Column) And _
(IsDate(Cells(Cell.Row, "M")) And IsDate(Cells(Cell.Row, "N"))) Then
Cells(Cell.Row, "O") = WorkingHours.WorkingHours(Cells(Cell.Row, "M"), Cells(Cell.Row, "N"))
End If
Next Cell
End Sub