I have the below code that is supposed to loop through a column of break times and a column of staff times. If the staff time is between 8:28 and 8:58, then if the break time is over 61 minutes, the cell should switch color. Likewise, if the staff time is over 8:58, if the break time is over 91 minutes, the cell should switch color. Right now, neither is happening, as something is obviously missing in the code.
Dim ttlBr As Range, stfTm As Range
Dim StfTm900 As Double, StfTm830 As Double, ttlBrTm900 As Double, ttlBrTm830 As Double
StfTm900 = TimeValue("08:58:00")
StfTm830 = TimeValue("08:28:00")
ttlBrTm900 = TimeValue("01:31:00")
ttlBrTm830 = TimeValue("01:01:00")
For Each ttlBr In Range("T2:T7")
For Each stfTm In Range("H2:H7")
If stfTm > StfTm830 And stfTm < StfTm900 Then
If ttlBr > ttlBrTm830 Then
Selection.FormatConditions(1).Interior.Color = 5263615
End If
ElseIf stfTm > StfTm900 Then
If ttlBr > ttlBrTm900 Then
Selection.FormatConditions(1).Interior.Color = 5263615
End If
End If
Next stfTm
Next ttlBr
What am I missing?
EDIT: Picture added for clarity

stfTm.valueSelection.FormatConditions, usettlBr.FormatConditionsif that is the number you want to format. Otherwise you are dependent on the location of the current cell selected.TimeValuewill set time, but date will be January 1 of the year 1.