EmployeeName Date WorkingFromTime WorkingToTime
emp1 1/1/2010 0:01 1:50
emp2 1/1/2010 1:00 5:00
emp1 2/2/2010 5:00 13:50
emp3 2/2/2010 1:00 5:00
emp4 1/1/2010 5:00 6:00
emp1 3/1/2010 9:00 12:00
emp2 3/1/2010 10:00 13:00
emp3 3/1/2010 14:00 16:00
emp2 3/1/2010 16:00 18:00
i need a VBA function which should accept the Date, Start Time , hours and headCount required as input parameter.
For example if i pass
example 1
Date as 3/1/2010,
Start Time 8:00
hours as 2
headCount as 2
My output i need as
emp1 10:00 12:00
emp2 10:00 12:00
because after 8.00 emp1 and emp2 have 14 to 16 hours free as common for 2 hours and head count as 2
It means this 2 employees are free at 14 to 16 (railway timing)
example 2
Date as 3/1/2010,
Start Time 8:00
hours as 2
headCount as 3
My output i need as
emp1 18:00 20:00
emp2 18:00 20:00
emp3 18:00 20:00
because after 8.00 emp1,emp2 and emp3 have 18 to 20 hours free as common for 2 hours and headcount as 3
It means this 2 employees are free at 14 to 16 (railway timing)
I am doing Employee Scheduling. So i need free time for more than one employee at same time
Bookmarks