Excel Macro Comparison & Cell Highlighting

T

Triscuit

Greetings,

I'm undertaking a personal project to help out my team at work
and save a lot of hours each week. This project involves loading data
from a file that has a set structure, building a data sheet listing
all agents and the week involved, highlighting their schedule on a
grid, deciding on an appropiate match for manager based on their
schedule, then determining if a team change is necessary or if they
should remain on the same team. Yes, quite an undertaking but I'm
going to work on it in steps. I would first like to develop a simple
macro to show the grid.

Data from file would show:

Brian
Sunday DATE 8:00AM-5:00PM
Monday DATE 9:00AM-6:00PM
Tuesday DATE 10:00AM-7:00PM
Wednesday DATE 11:00AM-8:00PM
Thursday DATE 12:00PM-9:00PM
Friday DATE 1:00PM-10:00PM
Saturday DATE 2:00PM-1:00PM

Columns E:GN are broken into 15 minute intervals beginning at
midnight.
0:00 0:15 0:30 0:45 1:00 1:15

An example of the output is below:

I am trying to have it highlight all cells that fall within the
schedule for each day listed. It would look like this when completed.
Col A Col B Col C Col D Col E
Brian Date Hours Blank *Grid* ( This would be solid black if
within the range. )

At this point I am just trying to develop a way to loop through each
column and runnnig a comparison for >= the start time and <= the end
time. I found several ways of looping through columns, but could not
resolve the "Range not defined" errors I kept receiving.

Any and all help is appreciated. I'm not asking for the final code,
but just a kickstart to get me going. I realize this project is
greatly beyond my current abilities, but I will learn as I progress
and hope to be able to share how well this works for us when
completed.

Thanks,

Brian
 
R

Rob van Gelder

Check my website for "Hours affected by Dates"
For a two date ranges, it will tell you how much time overlaps.

This, combined with conditional formatting, will do what you're after.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top