+ Reply to Thread
Results 1 to 2 of 2

Time durations in excel and VB

Hybrid View

  1. #1
    Owen
    Guest

    Time durations in excel and VB

    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!

  2. #2
    Bob Phillips
    Guest

    Re: 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" <Owen@discussions.microsoft.com> wrote in message
    news:4196FB1F-6BE4-4E32-B3DE-25601DFC8921@microsoft.com...
    > 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!




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1