View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Drew[_10_] Drew[_10_] is offline
external usenet poster
 
Posts: 2
Default subtracting two date/time columns to get total time

I've got two columns that have a value of "Now" (the second column is
added later...once someone tabs to it). Once the second one is filled
out, I need to subtract the two to get the total time spent. Here is
what I attempted to do, but I really have no idea what i'm doing or how
to get this:


ActiveCell.Offset(0, 1).Formula = "=TIME(HOUR(" & ActiveCell & "),
MINUTE(" & ActiveCell & ")) - TIME(HOUR(" & ActiveCell.Offset(0, -1) &
"), MINUTE(" & ActiveCell.Offset(0, -1) & "))

Any ideas?