+ Reply to Thread
Results 1 to 2 of 2

TimeSerial Format VBA

  1. #1
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    TimeSerial Format VBA

    Hi,

    Ive got a TimeSerial code for a ComboBox like this:

    Please Login or Register  to view this content.
    This code gives me the time with a step every 5min to choose.

    The problem of this code is that the first time that appears in the ComboBox is 00:05 (I would like to be 00:00) and the last time that appears in that list is 00:00 (I would like it to be 24:00)


    The reason why I would like it to work like that (if it helps for the solving this) is because I need to calculate the minutes between 2 situations.
    If it starts at 00:00 and ends at 24:00 the result should be 1440 minutes and in the code I attached its not possible to end up in this number cause the possible times are 00:00 for starting and 00:00 for ending, so the result would be 0 minutes.

    Hope someone can help me on this, thank you very much!

    Regards

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: TimeSerial Format VBA

    Hi, pezalmendra,

    instead of looping from

    Please Login or Register  to view this content.
    try
    Please Login or Register  to view this content.
    Ciao,
    Holger

  3. #3
    Forum Contributor
    Join Date
    07-22-2012
    Location
    Spain
    MS-Off Ver
    Excel 2008
    Posts
    304

    Re: TimeSerial Format VBA

    Hello,

    Now I have as start time the 00:00 so perfect!

    The only thing Im missing now is the end time that is 23:55. I tried doing it lngCounter = 0 To 288 but it will display as end time also 00:00

+ 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