+ Reply to Thread
Results 1 to 5 of 5

Calculate Time differance in label

Hybrid View

  1. #1
    Registered User
    Join Date
    11-13-2003
    Location
    India
    MS-Off Ver
    2007
    Posts
    65

    Calculate Time differance in label

    I have created userform in which I have set 2 labels , Start time and End time , when I close the user form , i want to display a msg of time differance

    Start label = Now() when form loaded or showed
    End label = now()-start label

    but msg showing empty


    pl. suggest
    mast

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Calculate Time differance in label

    Start = Timer
    msgbox "Duration: " & Timer - Start
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    11-13-2003
    Location
    India
    MS-Off Ver
    2007
    Posts
    65

    Re: Calculate Time differance in label

    Thanx
    Is it possible to display countdown timer in label of 00:30:00 (30 min) which can be further set as required time .It will be better if display hh:mm:ss:ms (milliseconds)

  4. #4
    Registered User
    Join Date
    11-13-2003
    Location
    India
    MS-Off Ver
    2007
    Posts
    65

    Re: Calculate Time differance in label

    Thanx
    Is it possible to display countdown timer in label of 00:30:00 (30 min) which can be further set as required time .It will be better if display hh:mm:ss:ms (milliseconds)

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Calculate Time differance in label

    For starters, using TIME vs. Timer:
        Dim TimeIs  As Date, _
            StopTime    As Date, _
            TimeZero    As Date
    
        TimeZero = Time
    
    'some other stuff between the start and stop times...
    
        StopTime = Time
        TimeIs = StopTime - TimeZero
        UserForm1.Label1.Caption = TimeIs
        UserForm1.Show
    Last edited by protonLeah; 11-04-2012 at 04:14 PM.

+ 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