View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Dealing with times in VBA

Use a formula like this

=IF((A2-A1)TIME(0,0,30),A2-A1,"")

ensure that the formula cell is formatted as [h]:mm:ss

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"joshroberts" wrote in message
...
I have a worksheet with data that has a time column with the following

format:
5/12/2006 1:52:00 PM
All of this is in one cell. I'm trying to do two things: read from cell

to
cell and identify when the difference is greater than 30 seconds. Then

when
that condition is met I would like to subtract the two and get the time
between. Your help would be greatly appreciated. Thanks.