Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is terrible programming but it works.
Dim n As Integer For n = 1 To 1440 'check if column 1 value is later than H1 If Round(Cells(n, 1).Value, 10) = Cells(1, 8) Then 'check if column 1 value is before I1 If Cells(n, 1) <= Round(Cells(1, 9).Value, 10) Then Cells(n, 2) = 1 End If End If Next n rounding any repeating values drops any repetition after the round point and forces the number to be less than what I am comparing it to. Rounding both to the same value doesn't seem to work. I am really surprised this behavior hasn't caused anyone else any problems. (Earlier I had changed all values to numbers 0-59,100-159,200-259,300-359... This worked beautifully as far as the =, <= comparisons were concerned but took about 5 seconds to loop as compared to less than a second with time values.) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subtract hours from a time and get the correct time | Excel Worksheet Functions | |||
Time comparison problem | Excel Programming | |||
Time Comparison | Excel Programming | |||
Time comparison formula | Excel Discussion (Misc queries) | |||
Time comparison | Excel Programming |