Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I am stuck on a concept, and I'm hoping someone might be able to provide me a nudge on the best VBA approach to do what I need to do.
I have a service time range (svc_start and svc_end). For this example svc_start = 9:00AM and svc_end = 8:00PM
I have a 10 staff scheduled throughout the day, their shifts are defined by shift_start and shift_end, values gathered from a range of values in a data range. What I need to do is determine whether any one particular employee, based on their shift, is able to provide a service within the service time range. Does an individual's shift overlap the service time?
eg
employee 1, shift_start =7:00A - 3:00P. This employee could provide a service within their scheduled hours 8:00A - 3:00P Response: YES
employee 2, shift_start = 12:00P - 8:00P. This employee could provide a service within their scheduled hours 12:00P- 8:00P Response: YES
employee 3, shift_start = 6:00P - 2:00A next day. This employee could provide a service within their scheduled hours 6:00P- 8:00P Response: YES
employee 2, shift_start = 9:00P - 5:00A next day. This employee could not provide a service within their scheduled hours as the service range is outside this person's shift Response: NO
Not certain how to code this logic. I will hazard a guess it's a pretty direct solution, but I can't wrap my head around it at this time.
I have a service time range (svc_start and svc_end). For this example svc_start = 9:00AM and svc_end = 8:00PM
I have a 10 staff scheduled throughout the day, their shifts are defined by shift_start and shift_end, values gathered from a range of values in a data range. What I need to do is determine whether any one particular employee, based on their shift, is able to provide a service within the service time range. Does an individual's shift overlap the service time?
eg
employee 1, shift_start =7:00A - 3:00P. This employee could provide a service within their scheduled hours 8:00A - 3:00P Response: YES
employee 2, shift_start = 12:00P - 8:00P. This employee could provide a service within their scheduled hours 12:00P- 8:00P Response: YES
employee 3, shift_start = 6:00P - 2:00A next day. This employee could provide a service within their scheduled hours 6:00P- 8:00P Response: YES
employee 2, shift_start = 9:00P - 5:00A next day. This employee could not provide a service within their scheduled hours as the service range is outside this person's shift Response: NO
Not certain how to code this logic. I will hazard a guess it's a pretty direct solution, but I can't wrap my head around it at this time.