+ Reply to Thread
Results 1 to 9 of 9

Countdown Timer

  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Countdown Timer

    I've searched quite a bit and found a lot of nice stopwatches but my difference is I want it to countdown from 2 minutes. Obviously i know I could run it up and stop/reset at 2 minutes but just seeing if it is possible to do it backwards from the others on here

    TIA

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Countdown Timer

    Quote Originally Posted by AMayland View Post
    I've searched quite a bit and found a lot of nice stopwatches but my difference is I want it to countdown from 2 minutes. Obviously i know I could run it up and stop/reset at 2 minutes but just seeing if it is possible to do it backwards from the others on here

    TIA
    It would be the same code as a 2 minute count up timer except when the Time Value is written to the cell, you subtract the timer's value from 2 munutes e.g.;

    Range("A1").Value = TimeValue("00:02:00") - MyTimer

    Where MyTimer is your timer's count up value
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Countdown Timer

    Hi TIA,

    Here is what I have done in the past. I modified it for 2 minutes.

    Please Login or Register  to view this content.
    Hope it helps,

    Dan

  4. #4
    Registered User
    Join Date
    03-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: Countdown Timer

    This works exactly how I need it to; however with the Application.Wait i assume it disables me from using the sheet, I am going to play around with it and see if I can add in a Start/Stop/Reset button.

    Thanks!

  5. #5
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Countdown Timer

    Hi TIA,

    I have attached a workbook that works. It has buttons to reset the timer, start it and stop it. I was able to get it to work in the background by using the "Workbook" activation section of the VBA project, so you can take a look and see if it provides any further help. I was able to copy/paste cells, modify cells, delete cells and switch between worksheets and the timer kept counting without interruption.

    Hope it helps,

    Dan
    Attached Files Attached Files
    Last edited by djbomaha; 08-08-2016 at 06:44 PM.

  6. #6
    Registered User
    Join Date
    03-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: Countdown Timer

    Thank you, I implemented into my book, had to remove part of the macro though because I couldn't get it to work. (worksheet change) I think it now stops the clock when I'm typing into it. I kinda like this feature actually but is there a way to reset the timer when I change a cell? I tried putting in a worksheet change sub but it didn't go to well. I attached my .xlsm below
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Countdown Timer

    Hi,

    I downloaded your workbook and revised it. It appears to be working for me now. I made some modifications by shutting off "Enable Events". I also put the handler for when a cell value changes under "Sheet1" rather than under the "Workbook" part of the VBA Project and it seemed to fix it.

    The revised workbook you posted is attached. I think it may throw an error after you first download it and enable it. If it does, just cancel out of the error, save the workbook, close it and reopen it and it should work. It has a macro that fires when the workbook gets opened and it may get confused when it tries to run it when you first enable it.

    Hope it helps,

    Dan
    Attached Files Attached Files
    Last edited by djbomaha; 08-09-2016 at 12:50 AM. Reason: Updated Macros

  8. #8
    Registered User
    Join Date
    03-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: Countdown Timer

    Thank You! Thank You!

    SOLVED

  9. #9
    Forum Contributor
    Join Date
    10-19-2012
    Location
    Omaha, Nebraska USA
    MS-Off Ver
    Excel 2010
    Posts
    249

    Re: Countdown Timer

    I did notice that the workbook I posted sometimes runs into a Stack Overflow error, so the macro for the timer was rewritten to avoid the issue by not having the macro continuously run in the background. What the workbook posted below does is fire the macro every 1 second and then close it so it clears the computer memory, thus avoiding the Stack Overflow.

    To stabilize the cursor so it doesn't flicker, the cursor is set to the Northwest Arrow when the workbook is opened and then sets it back to Default when the workbook is closed.

    Thanks,

    Dan
    Attached Files Attached Files

+ 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. Countdown timer
    By Trickypottermus in forum Excel General
    Replies: 3
    Last Post: 11-13-2013, 08:09 AM
  2. Countdown Timer
    By gkokaisel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2011, 08:02 PM
  3. Countdown Timer
    By colt seavers in forum Excel General
    Replies: 3
    Last Post: 01-12-2010, 12:23 PM
  4. countdown timer
    By alibaba in forum Excel General
    Replies: 4
    Last Post: 11-06-2009, 09:50 PM
  5. Countdown timer
    By ukmxer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2007, 02:49 AM
  6. HELP for COUNTDOWN TIMER
    By CC in forum Excel General
    Replies: 3
    Last Post: 05-08-2006, 07:55 AM

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