+ Reply to Thread
Results 1 to 5 of 5

Countdown Chronometer

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Countdown Chronometer

    I trying to figure out how to create a macro for a countdown chronometer, i need to be able to set the countdown value on sheet1 B1, need to be able to add a start, stop and reset button. What i need the macro to do is will allow me to set countdown on B1 to any value, stop the countdown at any moment, re start were it was stop, ten seconds before reach cero to turn button red and when reach cero to stop, when click reset button need it to set the same countdown value was before.

    Any suggestion is greatly appreciated... thanks in advance for any help!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,330

    Re: Countdown Chronometer

    Hi score,

    Watch this YouTube for your answer.

    https://www.youtube.com/watch?v=sbJeGG_Xv8M
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Countdown Chronometer

    Thank you MarvinP, great tutorial video, i have already watch this one and does have everything i need but the reset, i need to reset it manually and i don't have the vba expertise to edit it and add the reset part...

    Quote Originally Posted by MarvinP View Post
    Hi score,

    Watch this YouTube for your answer.

    https://www.youtube.com/watch?v=sbJeGG_Xv8M

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,330

    Re: Countdown Chronometer

    Hi score,

    Add a third button and name it "Reset".

    Make code for this button to

    Sub ResetTimer
    Sheet1.Cells(1,"B")=TimeValue("00:05:00") ' make this the time you want to reset it to
    starttimer
    End Sub
    What this will do is simply change the value in cell B1 back to your reset value.

  5. #5
    Forum Contributor
    Join Date
    04-22-2011
    Location
    Isabela, Puerto Rico
    MS-Off Ver
    365 Mac Excel Version 16.54
    Posts
    233

    Re: Countdown Chronometer

    Quote Originally Posted by MarvinP View Post
    Hi score,

    Add a third button and name it "Reset".

    Make code for this button to

    Sub ResetTimer
    Sheet1.Cells(1,"B")=TimeValue("00:05:00") ' make this the time you want to reset it to
    starttimer
    End Sub
    What this will do is simply change the value in cell B1 back to your reset value.
    MarvinP... Thank you very much for taking the time to help!! it does work perfectly!!

    Here the whole code to share

    Sub starttimer()
    Application.OnTime Now + TimeValue("00:00:01"), "nexttick"
    End Sub
    Sub nexttick()
    If Sheet1.Range("B7") = 0 Then Exit Sub
    Sheet1.Range("B7").Value = Sheet1.Range("B7").Value - TimeValue("00:00:01")
    If Sheet1.Range("B7").Value <= TimeValue("00:00:10") Then
        Sheet1.Shapes("TextBox 6").Fill.ForeColor.RGB = RGB(255, 0, 0)
    Else
    Sheet1.Shapes("TextBox 6").Fill.ForeColor.RGB = RGB(6, 13, 150)
    End If
    starttimer
    End Sub
    Sub stoptimer()
    On Error Resume Next
    Application.OnTime Now + TimeValue("00:00:01"), "nexttick", , False
    End Sub
    Sub ResetTimer()
    Sheet1.Range("B7") = TimeValue("00:00:20") ' make this the time you want to reset it to
    starttimer
    End Sub
    Last edited by AliGW; 07-29-2017 at 02:40 AM.

+ 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. How to create an Stopwatch (chronometer) using two buttons.
    By DiogoamCoutinho in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-28-2015, 10:40 AM
  2. Countdown
    By Dave_ross in forum Excel General
    Replies: 3
    Last Post: 11-28-2011, 09:47 AM
  3. Countdown
    By aliounis11 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-27-2011, 09:05 AM
  4. Countdown
    By knapper78 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-02-2010, 12:44 PM
  5. Countdown
    By simserob in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-21-2006, 09:40 PM

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