+ Reply to Thread
Results 1 to 12 of 12

Excel VBA Timer

  1. #1
    Registered User
    Join Date
    02-21-2019
    Location
    New Hampshire
    MS-Off Ver
    Excel 2011
    Posts
    9

    Excel VBA Timer

    Hi All, I have been some digging, but can't seem to find what I am looking for in regards to a count-down timer. What I would like to do is to be able to set up 10+ countdown timers on a single page with a start/stop/pause button.

    Each timer might be for a different time, say 15 minutes, 20 minutes, 1 hour, etc. Each would need it's own control button and hopefully make a noise when it counts down to 0.

    is this possible? If so, any hints or tips on where to find it.

    All the best, Frank

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Excel VBA Timer

    You will need to use the Ontime Function.

    This is best done on a Userform but is possible on a spreadsheet.

    I will look at the Spreadsheet option first.

    It will take me ten minutes.

    Not Quite Ready.

    But something to play with while I complete the code.
    Attached Files Attached Files
    Last edited by mehmetcik; 02-23-2020 at 08:13 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    02-21-2019
    Location
    New Hampshire
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: Excel VBA Timer

    Awesome, thanks for helping out.

  4. #4
    Registered User
    Join Date
    02-21-2019
    Location
    New Hampshire
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: Excel VBA Timer

    Maybe this will help for a format?
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Excel VBA Timer

    Ok.

    I have something for you to play with.

    I will look at your amendments once you have played with it and what you want from it.

    Not really sure what you want to occur when you select Stopped or Paused.
    Attached Files Attached Files
    Last edited by mehmetcik; 02-23-2020 at 08:56 PM.

  6. #6
    Registered User
    Join Date
    02-21-2019
    Location
    New Hampshire
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: Excel VBA Timer

    Sorry, you are right, Stop and Pause are the same thing. What I am trying to do with my Start/Pause is control each timer independently. So I may have 10 timers in the sheet, but only use 5 this time hence why I am looking for each to have their own stop/start/reset ability. Column A,B,C,D are great but each timer needs its own countdown clock so we can monitor it. Am I doing an ok job describing this?

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Excel VBA Timer

    We can work on this tomorrow.

    Now I have the bulk of it working we should be ok.
    Attached Files Attached Files
    Last edited by mehmetcik; 02-24-2020 at 08:26 AM.

  8. #8
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Excel VBA Timer

    curtsy of @Kellbellah? the ultimate in timing exercises


    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    02-21-2019
    Location
    New Hampshire
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: Excel VBA Timer

    This is perfect, with one issue. It crashes at Application.Speech.Speak (SayThis), any thoughts on why/how to fix it. I am running on a mac!


    Please Login or Register  to view this content.
    Last edited by Leith Ross; 02-24-2020 at 05:04 PM. Reason: Added Code Tags

  10. #10
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Excel VBA Timer

    Override the following three lines of code by placing an apostrophe in front of each line.
    If that does not work upload the attached file which is a far earlier version of mine.
    The time periods that populate the timer dropdowns are hidden behind the black frame in column 'A' (A2 to A10)
    A1 must be left blank as it gives the blank line at the start of the dropdown (use this to 'zero' a timer if needed)

    Please Login or Register  to view this content.
    Attached Files Attached Files

  11. #11
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Excel VBA Timer

    Attached a far simpler app (partially developed to keep an eye on hospital patient absences).
    type a number in 'green box' (column'I' "Timer") the number will be your minutes duration and press start.
    The code is very repetitious (easy to extend by copy/paste) alter the obvious variable references.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    02-21-2019
    Location
    New Hampshire
    MS-Off Ver
    Excel 2011
    Posts
    9

    Re: Excel VBA Timer

    Opps, I can't run it cause I am using 64-bit!

+ 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. [SOLVED] hwnd timer pause VBA countdown timer
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-05-2019, 04:25 AM
  2. Countdown timer Working BUT starting the timer repeatedly SPEEDS UP TIMER!
    By Vinospam in forum Excel Programming / VBA / Macros
    Replies: 67
    Last Post: 03-30-2019, 06:42 PM
  3. [SOLVED] Timer in excel
    By shina67 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-18-2019, 08:57 AM
  4. timer for 30 minutes and timer based events
    By mohak12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2014, 06:20 PM
  5. Replies: 1
    Last Post: 12-12-2012, 08:46 PM
  6. [SOLVED] Stopping a Timer / Running a timer simultaneously on Excel
    By Paul23 in forum Excel General
    Replies: 1
    Last Post: 03-10-2006, 08:10 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