+ Reply to Thread
Results 1 to 2 of 2

VBA countdown timer help, need it to stop.

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010, 2016, 2021-22
    Posts
    87

    VBA countdown timer help, need it to stop.

    I have a timer that starts with the code below, but I can't figure out a way to stop it with a seperate button. I've also attached the complete worksheet.

    Private Sub CommandButton1_Click()
    'This is the 20HR Day start button
    'Starts, pauses or continues the timer
    'Start the timer that determines when the clock should run and not run based on breaks
    If TimerStarted = False Then 'No workhour day has been selected yet
    TimerStarted = True 'set to True so that if button is hit again, it won't start routine again
    DayTimer20
    'Make sure our cells are initialized
    Initialize
    'Set the number of hours that will be worked that day
    WorkHours = 9.5
    'Copy the takt value to the display area
    Range("A1").Value = Range("A14").Value
    'Set the 10HR Flag to FALSE
    Range("E44").Value = False
    'Set to False so that all timers run initially
    StopTimer = False
    'Start the display takt timer
    ShowTimer
    'Start the goal timer
    Timer
    Else
    If TimerStarted = True Then 'if it equals false, then do nothing, since it's already running
    End If
    End If
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-12-2012
    Location
    Wichita, Kansas
    MS-Off Ver
    Excel 2010, 2016, 2021-22
    Posts
    87

    Re: VBA countdown timer help, need it to stop.

    [Solved]

    Private Sub CommandButton5_Click()
    DisableDayTimer
    TimerStarted = False
    Initialize
    StopTimer = True
    End Sub


    Don't know if it's correct but it worked lol.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Displaying a unique countdown timer with Start/Stop/Reset buttons on multiple lines
    By drememagik in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2017, 07:51 PM
  2. Countdown timer
    By Trickypottermus in forum Excel General
    Replies: 3
    Last Post: 11-13-2013, 08:09 AM
  3. Replies: 1
    Last Post: 12-12-2012, 08:46 PM
  4. stop this countdown timer macro
    By jacksten in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-25-2012, 10:57 PM
  5. Countdown Timer
    By gkokaisel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2011, 08:02 PM
  6. Countdown Timer
    By colt seavers in forum Excel General
    Replies: 3
    Last Post: 01-12-2010, 12:23 PM

Tags for this Thread

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