Results 1 to 2 of 2

Timer Countdown

Threaded View

  1. #1
    Registered User
    Join Date
    10-28-2011
    Location
    Staffordshire
    MS-Off Ver
    Excel 2003
    Posts
    21

    Timer Countdown

    Hi Folks, would it be possible for you to help modify my code,

    what im trying to do is create a countdown timer from 5 minutes and when the time is up close the excel application completey, this is the code i have now, its probably not right anyway thanks chris
    Private Sub UserForm1_Initialize()
    Dim dteStart As Date, dteFinish As Date
    Dim dteStopped As Date, dteElapsed As Date
    Dim boolStopPressed As Boolean, boolResetPressed As Boolean
    Start_timer:
    dteStart = Time
    boolStopPressed = False
    boolResetPressed = False
    Timer_Loop:
    DoEvents
    dteFinish = Time
    dteElapsed = dteFinish - dteStart + dteStopped
    If Not boolStopPressed = True Then
    Label2 = dteElapsed
    If boolResetPressed = True Then GoTo Start_timer
    GoTo Timer_Loop
    Else
    Exit Sub
    End If
    End Sub
    Last edited by Leith Ross; 10-29-2011 at 06:57 PM. Reason: Added Code Tags

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