View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Time durations in excel and VB

Time is held in Excel as a fractional part of 1 day. So if you declare a
variable as Double, you should be able to get it quite easily as a number

Dim myNum As Double
myNum = Range("D1").Value
MsgBox myNum


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Owen" wrote in message
...
I'm using VBA for excel. A formula in a cell calculates the timespan

between
two date/times in minutes. I need to extract this number from excel into

VB,
but it always converts the number to the date/time serial number! any help
appreciated - this should be easy!