Closed Thread
Results 1 to 12 of 12

Inserting a Running Clock Cell

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Inserting a Running Clock Cell

    Is it possible to insert a running clock into an excel sheet (ie so I can watch the time pass by in a cell) ideally in the form "mm:ss.0"?
    I've tried googling it and haven't managed to get any of the stuff that pops up to work.
    As it stands I want my sheet to run a timer in cell M2 starting from 00:00.0 with 3 on screen command buttons to control it (start, stop and reset), so if something happens I can stop the clock at the relevant time, and start it again from where it left off as required, then reset can put it back to zero when I want to.

    Thanks

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Inserting a Running Clock Cell

    Hello rencol,

    When the timer gets to "59:59.9" will it rest to zero or continue to "60:00.0" ?
    Will this workbook be doing any calculations while the timer is running?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Inserting a Running Clock Cell

    It can go back to zero, although it isn't intended to go beyond 20 minutes in normal service. Its not critical so any successful method of the bits I mentioned would be good.

    Generally the inputs will all be done while the clock is stopped (ie something happens, so I stop the clock and write it down, then start the clock again). If no calculations can be done while the clock is running thats fine.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Inserting a Running Clock Cell

    Hello Rencol,

    I'll put together an example worksheet with Start, Stop, and Reset buttons.

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,239

    Re: Inserting a Running Clock Cell

    You may want to have a look at the in cell clock demo here.
    Remember what the dormouse said
    Feed your head

  6. #6
    Registered User
    Join Date
    01-25-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Inserting a Running Clock Cell

    Leith, that would be fantastic, cheers.

    Romperstomper, thanks for the link, have read through it but it seems a bit above my level, and the workbook example seemed to have disappeared (is a couple of years old so not a massive surprise).

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Inserting a Running Clock Cell

    Hello Rencol,

    Always seems that when I need to finish something in a timely fashion, the universe has to bugger it up. My system crashed in the middle of creating the workbook. Good news is it is attached and working.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-25-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Inserting a Running Clock Cell

    Thanks, looks perfect when its running in your sheet. One thing I can't do is make it work in my sheet, probably just down to a complete lack of knowledge on my part. Few questions that may help:
    1) If I copy the macro to "Sheet1" and delete the "Worksheets("Sheet1")." bit it doesn't work, is there an easy way around this so the macro works if I duplicate / change the name of Sheet1?
    2) What are the names of the buttons? For some reason I can't get the properties window to open on your sheet, so I'm not sure what to tweak to fit into my sheet. Are they the names of the subs, and if so why isn't it followed by "_click"?
    3) Where does the assign macro function you use on the buttons come from? I'm using Excel 2003 and it doesn't seem to offer me that option?

    Its pretty late over here and I'm getting tired, which might be why I can't sort it, but thanks for the program as it at least gives me something concrete to work from.
    Cheers

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Inserting a Running Clock Cell

    Hello Rencol,

    The buttons are Forms Toolbar buttons, not ActiveX controls. To make this work with any
    worksheet, use the macro below.
    Please Login or Register  to view this content.

    To attach a macro to the Forms button, right click the button and choose "Assign Macro..."

  10. #10
    Registered User
    Join Date
    01-25-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Inserting a Running Clock Cell

    Ok, thats probably it then, I had made it with the control toolbox buttons not forms buttons, so there was no assign macro option.
    Will play with it tomorrow morning
    Cheers

  11. #11
    Registered User
    Join Date
    04-15-2011
    Location
    Porto
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Inserting a Running Clock Cell

    Hi

    I have seen the code Leith has made and it works perfectly.

    I have done a little change to it in order to have a timer counting down the time. However I am unable to make the time stop when it reaches "00:00.0", How do I do that?

    thanks

    the code I am using is:

    Please Login or Register  to view this content.
    Last edited by Dedes; 04-18-2011 at 09:38 PM.

  12. #12
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,239

    Re: Inserting a Running Clock Cell

    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.

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