Results 1 to 2 of 2

Adding a Pause Button into a time on excel

Threaded View

  1. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,432

    Re: Adding a Pause Button into a time on excel

    Option Explicit
    
    Dim CountDown As Date
    Sub Timer()
        CountDown = Now + TimeValue("00:00:01")
        Application.OnTime CountDown, "Reset"
    End Sub
    
    Sub Reset()
    Dim count As Range
        Set count = [A1] ' A1 contains the number of seconds for the countdown.
            count.Value = count.Value - 1
        If count <= 0 Then
            MsgBox "Countdown complete."
            Exit Sub
        End If
            Call Timer
    End Sub
    
    Sub DisableTimer()
        On Error Resume Next
        Application.OnTime EarliestTime:=CountDown, Procedure:="Reset", Schedule:=False
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. running timer in excel with start, pause and end button
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 09-23-2021, 04:36 AM
  2. [SOLVED] pause button in excel
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-24-2015, 10:16 PM
  3. [SOLVED] Is it possible to pause a macro with a button on the worksheet?
    By Mr.GfCs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-05-2015, 07:48 PM
  4. Play Stop and Pause Button
    By Stanley91 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2014, 12:03 PM
  5. Pause and resume button using VBA
    By kyod in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-08-2009, 08:36 AM
  6. Abort button for a macro(not the break key) and pause/resume button
    By c.vaibhav in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2009, 04:22 AM
  7. Excel 2007 : Macro pause button
    By Terri_Galloway in forum Excel General
    Replies: 2
    Last Post: 02-11-2009, 12:45 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