logandiana
Board Regular
- Joined
- Feb 21, 2017
- Messages
- 107
I have column D of times that I need to subtract 5 hours from each.
I wrote the following code:
I wasn't sure if this was the best way or not, but it seemed to work just fine until it came to a line where the time was 3 am for example. I get an error.
This made me think of another problem though. If it is 3 am and I am subtracting 5 hours, assuming I can fix the error, for those instances I also need to subtract 1 day from column C, which has the date.
Can someone help here?
Thanks
I wrote the following code:
Code:
For i = 2 To LR
If IsEmpty(data.Cells(i, 4)) = False Then
data.Cells(i, 4) = DateAdd("h", -5, data.Cells(i, 4)
End If
Next i
This made me think of another problem though. If it is 3 am and I am subtracting 5 hours, assuming I can fix the error, for those instances I also need to subtract 1 day from column C, which has the date.
Can someone help here?
Thanks