Closed Thread
Results 1 to 22 of 22

Stopwatch / Timer

  1. #1
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Stopwatch / Timer

    I have been looking for a "timer" type script that would:

    1. Show current elapsed time since it was started
    2. Allow me to work on other parts of my spreadsheet while still keeping track of the time
    3. Have a Start/Pause/Stop/Reset capability so I can pause the elapsed time while we take a break or something similar and then press start again and it will continue where it left off (I do not want it to count the time that it was paused in the elapsed time)
    4. Once I press Stop give me the ability to "timestamp" a specific field (B4 for example) with the total elapsed time.

    Has anyone seen anything like this floating around... I see a lot of discussion about timers but they don't seem to be elapsed timers with an ability to pause.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,705

    Re: Stopwatch / Timer

    I googled "Excel create stopwatch" and this was the first hit.

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=242

    If you don't like this one, there are more out there.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Re: Stopwatch / Timer

    Thanks for your post Alan. I had also done the Google Search and did look at that particular link. It didn't use start and stop buttons at all, and couldn't be paused and then pickup where it left off, and while it does have a counter it really didn't meet what I needed.

    The biggest hurdle I seem to be facing is getting it to run while I use the workbook for other things and the ability to pause it and then start it up again.

  4. #4
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Re: Stopwatch / Timer

    Might it be possible to do this with a FORM? Where the form could be up and doing it's timing but I could be using the actual worksheets on the workbook outside of the form?

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

    Re: Stopwatch / Timer

    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Stopwatch / Timer

    bmasella,

    Attached is a Stopwatch/Timer excel program I made that fits all your requirements. I even set it up so that you could do a SaveAs -> .xla file so you can use it as an Excel Add in and it will be available in all of your workbooks if you want.

    Here's the code for the actual Stopwatch/Timer userform. To change which cell the TimeStamp gets output to, just change the cell reference in btn_TimeStamp_Click():
    Please Login or Register  to view this content.


    Here's the code for the Add-in portion:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    08-13-2011
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    5

    Re: Stopwatch / Timer

    Thanks for the code. It does as i wanted.

  8. #8
    Registered User
    Join Date
    03-30-2012
    Location
    dunfermline, scotland
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Stopwatch / Timer

    Hello folks,

    Ive been looking for a stopwatch program, exactly as desribed on this page. Problem is that I need to call up three stopwatches each with a different title and all able to save data on the same page. Seems that all the code is here but im unsure how to setup the 2nd and 3rd stopwatches. Any ideas?

  9. #9
    Registered User
    Join Date
    04-16-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Stopwatch / Timer

    Thank you so much

  10. #10
    Registered User
    Join Date
    07-13-2012
    Location
    Calgary
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Stopwatch / Timer

    thanks, great little bit of code, Jim

  11. #11
    Registered User
    Join Date
    09-28-2012
    Location
    darwin oz
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Stopwatch / Timer

    Hi, Many thanks - excellent stuff - My need is to launch race cars in a handicap event at our club - my excel sheet calculates the handicap and puts that to a worksheet which lists cars in formup order with the start delay shown as a number, i.e. 5, 9, 14 second delay for cars 2, 3 & 4 on the grid, car 1 starts at 0:00. Your code goes a very long way to helping but I would love to be able to link the counter in your stopwatch to teh cell next to each car's start delay so that the word "GO" appears alongside each car as it's delay start time is reached, with "GO" staying alongside each entry once it has appeared. Start delays run from E:9..E63, calculated by this formula (from E9 on stopwatch worksheet)...=IF(ISNA(VLOOKUP(MATCH($B9,INPUT!$F$11:$F$65,0),INPUT!$A$11:$F$65,5)),"",VLOOKUP(MATCH($B9,INPUT!$F$11:$F$65,0),INPUT!$A$11:$F$65,5)) where "INPUT" is the worksheet that qualifying times are input to. So In the "stopwatch" worksheet I would like to have the word "GO" appear in cells F9..F63 , one by one as the delay in seconds in E9..E63 corresponds to the seconds (and minutes!) on teh stopwatch form. Any ideas would be appreciated.

  12. #12
    Registered User
    Join Date
    10-06-2012
    Location
    New Delhi
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Stopwatch / Timer

    I am looking for a timer.
    These are the specifications..
    1. I should be able to set the start time.
    2. It should have start pause and reset buttons like this stopwatch.

    Thank you for this code as it could help me understand a little more on how to build it.
    If you have a similar code available can you please post it.

    Thank You in advance.

  13. #13
    Registered User
    Join Date
    10-06-2012
    Location
    New Delhi
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Stopwatch / Timer

    Hi guys,

    I have been designing my Timer as required..but it shows Type mismatch in Show command.

    Please Help

    Answer Sheet 2 - Testing.xlsm

    I have attached a copy of my file

  14. #14
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Stopwatch / Timer

    @ vibhav_roy,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    HTH
    Regards, Jeff

  15. #15
    Registered User
    Join Date
    10-06-2012
    Location
    New Delhi
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Stopwatch / Timer

    Ok! I will do so.. sorry for the inconvenience.. but I have solved the problem which I had asked.. so I would like to paste my result here as well..

    Answer Sheet 2 - Testing.xlsm

    Sorry again for the inconvinience.. I will post new threads for each question from now on

    Regards,
    Vibhav Roy
    Last edited by vibhav_roy; 10-06-2012 at 01:36 PM.

  16. #16
    Registered User
    Join Date
    08-24-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Stopwatch / Timer

    how cai i change this timer to paste the partial time (from timestamp button) always in a new cell, b4, b5,b6....
    each time i press timestamp, copy the value to the next free cell

  17. #17
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Stopwatch / Timer

    zykon,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  18. #18
    Registered User
    Join Date
    04-26-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Stopwatch / Timer

    So I created a timer using tigeravatar's code. I modified the timestamp to record time and enter the values into the workbook beginning in a certain row and moving on to the next row for each successive time stamp. I also had it reset the timer to zero after time stamp.

    My only issue now is that when i'm using other workbooks, if the timer is running, I can't do the following:

    1. open another excel file from outside of excel (e.g. opening a file through windows explorer or trying to open a link from outlook, etc..). I can still use the open file dialog box and open a file that way.. just can't open an excel file outside of excel.
    2. the undo button doesn't work anymore. i have other spreadsheets open while the timer is going but the undo/ctrl-z does not seem to work. the undo button is just greyed out.

    If I pause the timer or close the stopwatch, then everything works like normal. is this just a limitation of excel or is there a way to fix/workaround this?

    Thanks in advance!

  19. #19
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Stopwatch / Timer

    sca1079,Welcome to the Forum.

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    Two previous posters were also warned; you chose to ignore those and hijack anyway.
    Ben Van Johnson

  20. #20
    Registered User
    Join Date
    12-16-2013
    Location
    Saskatchewan, Canada
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Stopwatch / Timer

    Thank you, Thank you, Thank you.

  21. #21
    Registered User
    Join Date
    07-22-2015
    Location
    Florida, USA
    MS-Off Ver
    2013 Pro
    Posts
    3

    Re: Stopwatch / Timer

    Any ideas on how I can run this code and open separate workbooks?
    Last edited by jeffreybrown; 07-27-2015 at 07:17 PM. Reason: Removed quote

  22. #22
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Stopwatch / Timer

    Hi isabela1214,

    Please start your own post and reference back to this original thread for added info if required.

Closed Thread

Thread Information

Users Browsing this Thread

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

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