Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I am looking for some help with the following vba formula ...
I am trying to get a time value (mm2) that is 30 minutes less the time value in sh.cells(rw,6). This code isn't doing it.
The value in sh.Cells(rw,6) = 46061.8541666667 (2023-05-15 8:30 PM)
The resulting value of mm2 = 2023-05-15 8:30 PM
I was hoping to get mm2 = 2023-05-15 8:00 PM
VBA Code:
mm2 = DateAdd("h", -0.5, sh.Cells(rw, 6))
I am trying to get a time value (mm2) that is 30 minutes less the time value in sh.cells(rw,6). This code isn't doing it.
The value in sh.Cells(rw,6) = 46061.8541666667 (2023-05-15 8:30 PM)
The resulting value of mm2 = 2023-05-15 8:30 PM
I was hoping to get mm2 = 2023-05-15 8:00 PM