Working with times

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Please Help,
I have 2 times say, 08:00:00 & 10:00:00, what i need to
do is find out how many 15 min are between 2 times (here there are 8).
I have managed this:
Range("Ae3").Value = ((Range("ad3").Value - Range("ac3").Value) / 0.25)
where d3 = 08:00:00 and c3 = 10:00:00 this gives the answer of 00:08:00. I
need to just extract the number 8 so I can use it in a for to nexrt loop, to
the show the 15 min intervals between the 2 dates ie 08:15:00, 08:30:00
,08:45:00 etc.
Or is there an easier way?

Thanks


Dave
 
try this instead

Range("Ae3").Value = ((Range("ad3").Value - _
Range("ac3").Value) / TimeValue("00:15"))

to illustrate from the immediate window:

? (timevalue("10:00")-timevalue("8:00"))/timeValue("00:15")
8
 
Back
Top