+ Reply to Thread
Results 1 to 3 of 3

Converting a Date-Time code to seconds

  1. #1
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Converting a Date-Time code to seconds

    Hello all
    I am running into a problem converting a date-time code value into seconds, I can get the days & hours just fine, but figuring out the minutes and seconds is baffling me !
    I do have a working Function for the converting to seconds based on the following:
    =TCode2Secs(Day(cell),Hour(cell),Minutes(cell),Seconds(cell))
    but I would prefer to have it just have the cell referenced just once :
    =TCode2Secs2(cell)
    So far I have got this
    Please Login or Register  to view this content.
    Any help would be greatly appreciated
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,796

    Re: Converting a Date-Time code to seconds

    If I was doing this with a formula I would just multiply by 86400, e.g. if date/time in A1

    =A1*86400

    Can't you do the same in VBA.......or am I misunderstanding your intent?
    Audere est facere

  3. #3
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Converting a Date-Time code to seconds

    Thanks daddylonglegs, thats exactly what I wanted, I just over-thought the problem I guess
    there is some additional processing going on in the UDF, but the seconds conversion was the problem !

    Thanks again

+ 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