Closed Thread
Results 1 to 21 of 21

running timer in excel with start, pause and end button

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    running timer in excel with start, pause and end button

    need your help... i tried my best to google a solution for this but all my searches just doesn't fit right... so i now turn to the experts...

    i need to create three buttons in excel which will do as follows:

    start button - put in cell k4 the actual time a task will start and at the same time start a running countup timer in k3.
    Pause button - it will pause the countup timer in k3. Then the word "pause" will turn to "resume" so user can click on it when he wants to restart the timer. Note that when user clicks on pause/resume button, the time recorded in k4 should NOT be changed (because all this data needs to be transfeered in a database).
    stop button - put in cell l4 the actual time a task was stopped and at the same time stops the timer in k3

    Really appreciate any help you could give me

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: running timer in excel with start, pause and end button

    Please find the attached workbook and see if this does what you are trying to achieve.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    hello sktneer..

    first thanks for taking time in this macro.. just need some revisions please...

    in the running clock, would it be possible to change it to a timer (like 1 2 3 4 5 and so on) instead of a clock? the reason is because when i clicked on stop, the total time spent being recorded is from the time started - time stopped. it was not able to deduct the time a task was paused. i need to see the total time a certain task was performed, not including when the timer was paused

    thanks again for your help dear.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: running timer in excel with start, pause and end button

    Quote Originally Posted by melody10 View Post
    hello sktneer..
    the reason is because when i clicked on stop, the total time spent being recorded is from the time started - time stopped. it was not able to deduct the time a task was paused. i need to see the total time a certain task was performed, not including when the timer was paused
    Did you notice L4 which shows what you require i.e. (Time Stopped - Time Started) and that is the time for which a task was performed not including the paused time?

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    i did see L4 but when i checked on it, it was including the time when it was paused.. i'll check again and let you know.

  6. #6
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    i have re checked and i do not know if i am doing something wrong but L4 is just subtracting time start and time stop, even if i have paused the timer in between.

    forgive my ignorance.. hope you can point me in the right direction.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: running timer in excel with start, pause and end button

    Actually I don't understand that what you are trying to achieve.

    Lets take an example like the below one.....

    Suppose you apply the timer in the following way.....

    Started Time
    ________9:00:00 AM

    Paused_____________9:10:00 AM (for next 20 minutes)

    Resumed____________9:30:00 AM

    Stopped Time________9:40:00 AM

    So considering the above case, what actual time do you think, you have taken to complete a task?

    Right now the code will return 00:20:00 (20 minutes) in L4, which I think is the actual time taken by the task. Because the timer actually ran for 20 minutes and it was paused for rest of the time. What do you say?

    Or do you want to get 00:40:00 (40 minutes) in L4 which is stop time - Start Time?

    Please find the attached workbook where L4 displayes the Stop Time - Start Time.

    So now you have two codes, see which one meets your requiremet.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    hello sktneer.. sorry for my very delayed response. i had to attend to some things.

    regarding above, thanks very much!!! it's doing exactly what i need. reallyappreciate your help.

    one question though, when i start the timer and then try to open a new excel file, the running timer is transferred to the new file i opened. is it possible to remove this feature? but the timer should continue to run in the background.

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: running timer in excel with start, pause and end button

    See the attached.
    Attached Files Attached Files

  10. #10
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Re: running timer in excel with start, pause and end button

    here is a stop watch and count down timer on a userform.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    sktneer.. thanks so much.. i'm checking on your attachment now.

    Cobralad.. thanks too for your attaced file. im not familiar with userform.. question, how do i use your attached file? how do i launch the user form? and would it be able to save the data in excel file?

  12. #12
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    sktneer... im really really sorry if i have too many requests.. when i tried using your latest file... at first the timer works ok... but while the timer is running, and then i open a new excle file.. the timer resets its counting... is it possible that the running clock would continue to run even if i transferred to another excel file? similar to the first file you did?

  13. #13
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: running timer in excel with start, pause and end button

    See the attached.

    If that takes care of your original question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    06-24-2013
    Location
    philippines
    MS-Off Ver
    Excel 2007
    Posts
    199

    Re: running timer in excel with start, pause and end button

    thank you soooooooooooooo much!!! you are a life saver

  15. #15
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: running timer in excel with start, pause and end button

    You're welcome. Glad I was able to help.

  16. #16
    Registered User
    Join Date
    10-18-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    1

    Re: running timer in excel with start, pause and end button

    Dear sktneer,

    I would like to use the timer file with a few changes to it. But, unfortunately, I couldn't succeed and here I'm. Here's what I'm trying to accomplish.

    I want my users to capture start and stop timing in column 5 & 6 for all the individual activities they record in the sheet, which is done.

    The problem I encounter is
    1. When I select a different cell in column 5 the timer starts again and stops the prior one.
    2. When I select a different cell in the different column the timer starts again and stops prior and give me the popup message. Here's the code with changes made so far, correct me, please.

    Sub Start_Timer()
    If Selection.Column <> 5 Then
    MsgBox "Incorrect Selection"
    Else
    Application.OnTime Now + TimeValue("00:00:01"), "IncreamentTimer"
    End If
    End Sub

    Sub IncreamentTimer()
    If Cells(Application.ActiveCell.Row, 5).Value = "" Then Cells(Application.ActiveCell.Row, 5).Value = TimeValue(Now)
    If Cells(Application.ActiveCell.Row, 6).Value = "" Then Cells(Application.ActiveCell.Row, 6).Value = TimeValue(Now)
    Cells(Application.ActiveCell.Row, 6).Value = Cells(Application.ActiveCell.Row, 6).Value + TimeValue("00:00:01")
    If Range("J3").Value = "" Then Range("J3").Value = "Timer ON"
    Range("J4").Value = "Timer Start Time"
    Range("J3").Font.Color = vbGreen
    sTimer = True
    Start_Timer
    End Sub

  17. #17
    Registered User
    Join Date
    11-30-2018
    Location
    USA
    MS-Off Ver
    2007
    Posts
    1

    Re: running timer in excel with start, pause and end button

    Thank you,

    I am trying to figure out how to use this sheet to track someones time on more then one task at the same time. can I copy code to each tab?

  18. #18
    Registered User
    Join Date
    05-25-2021
    Location
    India
    MS-Off Ver
    10
    Posts
    2

    Re: running timer in excel with start, pause and end button

    Hello All,

    Please help me to build this sheet for multiple task time monitoring.
    I tried doing it but couldn't succeed.

    It should have 4 to 5 task per day. I want to track my monthly task and time consumption.

    I am having sample sheet. Let me know how to attach it here.
    My contact details xxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Thanks,
    Aniket
    xxxxxxxx
    Last edited by FDibbins; 05-26-2021 at 01:00 AM.

  19. #19
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: running timer in excel with start, pause and end button

    Quote Originally Posted by aniketk06 View Post
    Hello All,

    Please help me to build this sheet for multiple task time monitoring.
    I tried doing it but couldn't succeed.

    It should have 4 to 5 task per day. I want to track my monthly task and time consumption.

    I am having sample sheet. Let me know how to attach it here.
    My contact details xxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Thanks,
    Aniket
    xxxxxxxx
    1. Do not post personal info on public forums.
    2. do not post duplicate threads.
    3. Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  20. #20
    Registered User
    Join Date
    09-19-2021
    Location
    Athens
    MS-Off Ver
    2007
    Posts
    9

    Re: running timer in excel with start, pause and end button

    Hi all, i was wondering if there is a way to modify the timer that was posted by sktneer so it can count milliseconds as well and have this format hh:mm:ss.00?

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,703

    Re: running timer in excel with start, pause and end button

    Administrative Note:

    Welcome to the forum.

    Do you really have the very old Excel 2007???

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Create running stopwatch/timer with 1 button (start/stop). No reset button.
    By leeroy2612 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-26-2021, 12:59 AM
  2. Pause and Resume for Excel timer
    By unfolgsamone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2014, 05:25 PM
  3. Countdown Timer in Excel with a "pause" and "start" button
    By bbhagwat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2013, 05:49 AM
  4. Replies: 0
    Last Post: 06-24-2013, 04:24 PM
  5. Countdown Timer Pause and Resume Button
    By table83 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-07-2010, 08:37 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