Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,616
- Office Version
- 365
- 2016
- Platform
- Windows
I'm looking for a vba solution to round up or down a time to the nearest 15 minutes.
If a time is between 0 and 6 minutes then the time will be h:00.
If a time is between 7 and 15 minutes then the time will be h:15.
If a time is between 16 and 22 minutes then the time will be h:15.
If a time is between 23 and 30 minutes, then the time will be h:30.
If a time is between 31 and 37 minutes, then the time will be h:30.
If a time is between 38 and 45 minutes, then the time will be h:45.
If a time is between 46 and 52 minutes, then the time will be h:45.
If a time is between 52 and 59 minutes, then the time will be h+1:00.
variable ssoff represents the time.
Example:
ssoff = 8:09 PM
after new code adjust as above,
ssoff= 8:15 PM.
Thoughts?
If a time is between 0 and 6 minutes then the time will be h:00.
If a time is between 7 and 15 minutes then the time will be h:15.
If a time is between 16 and 22 minutes then the time will be h:15.
If a time is between 23 and 30 minutes, then the time will be h:30.
If a time is between 31 and 37 minutes, then the time will be h:30.
If a time is between 38 and 45 minutes, then the time will be h:45.
If a time is between 46 and 52 minutes, then the time will be h:45.
If a time is between 52 and 59 minutes, then the time will be h+1:00.
variable ssoff represents the time.
Example:
ssoff = 8:09 PM
after new code adjust as above,
ssoff= 8:15 PM.
Thoughts?