Macro to quickly check compliance breaches.

Tezzadactyl

New Member
Joined
Jan 19, 2016
Messages
43
Hi, I have been been trying to sort this problem out by myself, but after spending a lot of time, I haven't been able to find the solution I am after.
I then tried to see how smart AI could be, and although it looked like it was going to give me the results I needed, it could not get it right and i ended up going around in circles.
I am responsible for checking the compliance of drivers of our trucking fleet. Every day I receive an email with a spreadsheet from a company that GPS track our trucks, this shows me the Fleet number of the trucks, time stamps, GPS position and whether the truck is stopped, at idle, or mobile and at what speed its moving at.
I then have the time sheets for our drivers which show start time, break start and stop times, and end of day time.
I want a macro that I can run that will give me a pop up to input from the drivers run sheet, the Fleet number, start time, number of breaks (Up to 5) break start and finish time for each of the breaks, and the end of day time.
When I have input the data from the time sheets, I would like the row that matches the fleet number to be highlighted yellow.
I would then like to search the section of the spreadsheet between that fleet number, and the next occurrence down of any fleet number. this is just to isolate the time stamps relative to just that fleet number.
I would then like to highlight in green, all the rows that completely encapsulate the period of time that was input as a break from the drivers time sheet.
Then searching within that green section, I need any rows where the truck is in motion to be changed from green to red.
If I could have a macro that when I open the spreadsheet, i click on a button, input the timesheet data, then have the highlighted areas indicated, it would save me a lot of time, and guarantee accuracy of my checking.
If I could get this working correctly, I might have further modifications to improve it even more.
I someone can work with me to get this right, I'd be very grateful and also impressed that the human brain can still give better results than AI!
1689337504513.png
1689337504513.png
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,894
Messages
6,175,254
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