Part of my macro uses the following if statement. It works fine until Cells(1,z) = Cells(y,6) when it insists on evaluating the if statement as true. Cells(y,5) and Cells(y,6) represent the start and end of shifts and Cells(z,1) run from 00:00:00 to 23:00:00 hourly. The idea is that eventually I can sum down the columns to get the amount of time worked during that hour period in total.
Code:
For z = 10 To 33
If (((Cells(y, 5) < Cells(y, 6))
And (Cells(1, z) + 6.94444444444444E-04 >= Cells(y, 5)
And Cells(1, z) + 6.94444444444444E-04 < Cells(y, 6)))
Or ((Cells(y, 5) > Cells(y, 6))
And (Cells(1, z) + 6.94444444444444E-04 >= Cells(y, 6)
Or Cells(1, z) + 6.9444444444444E-04 < Cells(y, 5)))) Then
Cells(y, z) = 4.16666666666667E-02
End If
Next z