Highlight column based on current date and time

29 Views Asked by At

Good day,

For work I have a sort of attendance sheet for the whole week, where each day has two timeslots. To make it "quicker" to work with, I'd like to highlight relevant sections; in this case the columns corresponding to the current date and time.

Is there some formula for conditional formatting, or perhaps VBA code that could do this? For reference I added a screenshot of the sheet.

enter image description here

What I'm trying to achieve for example is that if I open the sheet on monday morning, april 1st at say 10 AM, the whole column F-I will be highlighted. If I open the sheet in the afternoon, column K-N will be highlighted, and so on.

Appearance of cells is not fixed in stone, so if I would need to make adjustments to optimize the solution, that's definitely a possibility.

At this point, the only somewhat proper solution is conditional formatting for "Today". But that only highlights the cells with the current date and does not account for the time.

I'd also like to highlight the entire column, not just the cells.

enter image description here

0

There are 0 best solutions below