How to tell how when time belongs to one day and the same belongs to the next day

Computerman

Board Regular
Joined
Mar 3, 2016
Messages
91
I apologize in advance for the novel that follows
I have created a technician break schedule for a project that can run 20 hours or more. The schedule is dynamic in that it will expand to the number of technicians that are onsite on any given day, which varies from day to day. The technicians are given a 45 minute break after 4 hours, a one hour break 4 hours later, a 30 minute break 4 hours later, a 6 hour break 4 hours later, another 30 minute break 4 hours later, then a 1.5 hour break, a 2 hour break, another 30 minute break, and one more 6 hour break all 4 hours after the return time from the break before. The installs the technicians are performing span the country so time zones need to be accounted for. I have worked all the above out and it works well. I have also included in my project a timer that will fire off code automatically at one minute intervals (I can change that time span) which also works well. The Problem I am having is that I now want to incorporate a color coding scheme so that breaks that have passed before the current time are color coded red, breaks that are coming up within 15 to 30 minutes are color coded yellow, and future breaks, beyond the 15 to 30 minute window for upcoming breaks are not color coded. However, when I put in code to check if the cells time is after the current time it does not take into account which day the time in the cell is referring to. So not only are the cells that contain the break times for this morning coloring red, which they should, but the times for tomorrows break times are also coloring red, which they should not. Futhermore, when I check the cells that contain the break times, some of the cells just have the time, while others have a date of 1/1/1900 and the time although the same time calculations are used to fill out all the cells. If you have continued to read this novel to this point I thank you, if you have any suggestions to resolve my issues, I thank you again.

Computerman
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
REOLVED.
I found that by checking the preceding cell's interior color I can set my code to only look at the cells whose preceding interior color is red, other wise do not check the cell

Computerman
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top