I have some code that looks through a range and determines if it falls within a certain time based on the state. If not, then it colors a row of cells. My states are in column C and my times are in columns N and O (as you can probably tell from the code below).
It’s duplicated many times (almost every state) and the only variations are the state names and the times that determines the coloring.
Below is a snippet for Georgia.
Dim N As Long For N = 2 To 1000 If (Range("C" & N) = "Georgia" And Hour(Range("N" & N)) > 7 And Hour(Range("N" & N)) 7 And Hour(Range("O" & N)) < 22) Then Range("A" & N & ":Z" & N).Interior.ColorIndex = 34 End If Next N
What I have works just fine, but I'm wondering if there is a quicker or more efficient way of doing this?
Thanks in advance.