+ Reply to Thread
Results 1 to 45 of 45

Multiple Timer

  1. #1
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Multiple Timer

    Hi guys,
    I'm trying to create a file with the ability to record more timers, but I have some difficulties.
    This file will be used for sports competitions (for example a cycling race) in which a certain number of athletes (more or less 20 people) start together and arrive at different times.
    In my mind this file consists of a single start button (in a cell at the top of the page) and below it several stop buttons (one for each athlete) inserted in different lines with the related end times next to them. No need for pause/resume buttons.

    Really appreciate any help you could give me
    Last edited by Luke78; 11-22-2018 at 11:52 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Hi and welcome to the forum

    Does the attached help.

    Rather than lots of buttons to stop the time double click an athletes name in row 3.

    It uses this sheet Change macro

    Please Login or Register  to view this content.
    And this macro attached to the biuttons to start the clock.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Richard Buttrey; 11-12-2018 at 12:20 PM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Thanks Richard!
    It's a good base to work on. Maybe it would be useful to have a version with the names of the athletes placed in the rows and not in the columns, in order to have until 40 athletes in the same sheet..
    could you help me with this variation?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Hi,

    See tha variation attached
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Perfect! thanks Richard!
    last question... is it possible to change the color of the cell (relative to the athlete) after double clicking? This function can be useful to see who has already arrived, avoiding errors.. blue = normal and green = after double clicking..
    and maybe even the start button could change the color when you click on it, so it would be easier to understand that the time has started..

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Hi,

    See attached

    A double click on the Athlete makes it green. If you've made a mistake a double click again when the athlete cell is green will paint it blue.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Thank you!! it's perfect! exactly what I was searching for!

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    My pleasure. Glad to have helped.

  9. #9
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Is possible to have the time value in the format "hh.mm.ss,0" and not in "hh.mm.ss"?

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Try this one.

    It has two decimal places for seconds but if you want just one change the format to "hh:mm:ss.0"

    Note that it's a full stop (period) not comma
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    thanks Richard,
    I'm testing the file and when you stop one of the times (by double clicking on an athlete) there is run-time error '13' ...
    moreover the format of each time has 5 decimals and not 2..img_timer.jpg

  12. #12
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    @Luke78
    I was looking at Richards workbook yesterday out of interest and I encounter neither of the problems you describe. Can you post up the workbook you have those results in.

  13. #13
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    I've simply downloaded Richard's workbook v3_timer.xlsm and run it... You can see the results on the screenshot above.. The format of the time is h.m.s,00000 and I don't know why....
    and there is also the run time error '13'...
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    I've this error on VBA, see attached

    errorVBA.jpg

  15. #15
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Hi,

    I've used the latest file you uploaded and don't get the error you show.
    The difference since the last working version is the use of the VBA Timer command. I'm wondering if your Italian version of Excel recognises this.

    Are you able to go into VBA and in the Immediate window enter
    Print Timer

    It should return a number which is the number of seconds and decimals of a second since midnight.

    Actually the requirement to show decimal seconds has not been straighforward. When Excel captures the time by either the user entering the function =TIME() it defaults to (presumably) the nearest second and doesn't contain anything which represents fractions of seconds.

    When you asked for decimal seconds it then required use of the Timer VBA function. That allowed the start and stop time to be captured and converted into a string which reflected the decimal seconds. However I had assumed that the Eleapsed time which shows the difference between the start and stop times would reflec the decimal seconds but I've just noticed it doesn't.

    I'll need to work out how to work around that.

    The first thing to do though is find out why your system won't work. Click then Debug button when the macro halts and let me know which line of VBA code it stops on.

  16. #16
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Hi,

    I've done Print Timer, the result is 41342,83

    You can see the line of VBA code in my post above. Anyway the line highlighted in yellow is:


    Target.Cells(1, 4) = Format(Target.Cells(1, 3) - Target.Cells(1, 2), "hh:mm:ss.0")

  17. #17
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    This version now contains decimal seconds in the elapsed time column.

    It still uses the TIMER syntax as before and as we don't know why your system failed last time then it's possible this one too will trip up.

    I've noticed occasionally that the decimal second elapsed time is 1 decimal second different to the start & stop times recorded. I believe this is probably due to rounding and the very very small time difference that the macro takes to process.
    Attached Files Attached Files
    Last edited by Richard Buttrey; 11-17-2018 at 11:51 AM.

  18. #18
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Hi Richard,
    unfortunately I find the same error found with the previous version..
    below you can see the screenshot of the excel file and the VBA code error.

    errorVBA_2.jpg

    errorVBA_3.jpg

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

    Re: Multiple Timer

    I note in your output the decimal separator is "," not "." (point) as in the coding format.
    Is this possibly the problem due to regional settings, try temporarily setting to US or UK to see if the coding format is the problem.

  20. #20
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    I'm struggling to understand why you encounter a problem.

    Would you comment out that row and run the macro to establish whether it is just that row that causes a problem.

    If it runs without a problem please refer to this article and check out whether there are any MISSING objects when you select Tools..References in VBA

    https://social.msdn.microsoft.com/Fo...forum=exceldev

    I'm assuming you have not deleted any of the hidden helper columns on the left?

  21. #21
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    I've run the macro and the problem is in the same line..
    of course I didn't modify any columns..

  22. #22
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    I changed my regional settings here to a a few other variants of time and run into no problems on any of them. Can you try that workbook on another pc??

  23. #23
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    I've tried on 3 different PCs but... no way... same error..

  24. #24
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Quote Originally Posted by Luke78 View Post
    I've tried on 3 different PCs but... no way... same error..
    Do they all have the same Windows 7?
    Are you able to check on another Windows version?
    What version of Excel are you using?

    Did commenting out that row allow the macro to run, albeit without filling in the elapsed time?

  25. #25
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Quote Originally Posted by nigelog View Post
    I changed my regional settings here to a a few other variants of time and run into no problems on any of them. Can you try that workbook on another pc??
    Thanks for chipping in to help Nigel. This is curious.

  26. #26
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    @Richard
    timer runs faultlessly whatever way I format it. I was curious because I was thinking of adapting it for yacht racing


    Edit: @ Richard, yes the timer does show that error on Italian region setting. For some reason I checked Spain
    Last edited by nigelog; 11-20-2018 at 08:20 AM.

  27. #27
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    @Luke,

    It seems that regional settings may be the problem here. Would you temporarily set your Windows regional setting to English(United Kingdom) and the run the macro

  28. #28
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    With regional setting on Italian the code runs but only if the decimal separator is set to "."

    I tried a few changes within the code but can only get it to work on Italian settings if the above is done

    Hope this helps or narrows down the solution

  29. #29
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    @Richard,

    I've changed my Windows regional setting in English (UK) and the program runs!! it also works setting English (US)..

    @nigelog,

    I've set the decimal separator to "." but I have the same problem as before..

  30. #30
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    @ Luke
    I changed it through control Panel > Region and Language > Italian (Italy) - Advanced Settings - Decimal Separator (drop down list choice of two)

    This is Office 2016 64bit running on Windows 7 Professional
    Last edited by nigelog; 11-20-2018 at 11:49 AM.

  31. #31
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    @nigelog
    Yes! It works! I've changed the settings as you said and the program runs!

  32. #32
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    Ok guys it seems that using the UK settings for decimal separator, the program work correctly..
    Unfortunately on my PC I have to use Italian setting with "," as decimal separator......
    So I ask you if it's possible to have a version of the program suitable for Italian settings.. I know that it's not easy because you usually program and write VBA code with your settings..
    So doesn't matter if you cannot do it, your support it's been very helpful up to now, thanks a lot!

  33. #33
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Hi Luke

    See if the attached helps.
    There's only one line of code in the Sheet Double Click event procedure that formats the time as a decimal and I've changed that to...

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

  34. #34
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    @ Richard, first thing I tried. Doesn't help

  35. #35
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Quote Originally Posted by nigelog View Post
    @ Richard, first thing I tried. Doesn't help
    Mmmm....Thanks Nigel. I'm struggling a bit here..

    I'll need to think a bit more...............

  36. #36
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    I confirm, same error as before....

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

    Re: Multiple Timer

    Hi Richard & Luke
    Try the attached file
    I have eliminated the helper columns and changed the time format and eliminated the 'Function' as decimal seconds were unstable.
    It works in both UK & Italian without any need to alter anymore coding.
    The Italian regional time format needs reselecting to,
    Control Panel > Regional settings > Customise > Time > select "HH:mm:ss" > apply > apply > OK
    Note only the separators change from points to colons.
    Hope this works on all versions of Excel & Windows.
    torachan.
    Attached Files Attached Files

  38. #38
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    @ torachan

    Fair Play, works here on both "," and "." for italian settings

  39. #39
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    @ torachan

    GOAL!!! It works! good job!!

  40. #40
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Multiple Timer

    Well done Torachan.

    Who would have thought that the full stop (period - .) trailing the 'ss' would make all that difference. I've never seen that particular formatting example.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I've edited my original which contained a similar line of code but without the 'ss.' and jus 'ss' and that seems to work OK as well

    Relief all round....

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

    Re: Multiple Timer

    Praise has to go to Richard for taking on and persevering with the original request.
    It was merely by chance I finally recognised it has a similar time related format idiosyncrasy I had encountered in the past.

  42. #42
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    thanks, really a good job!
    Last request... I have to use this file to create a data sheet for cycling races, so I need to use the two-three columns on the left of the column "athletes". The problem is that when the time is reset, the program deletes the second column on the left of athletes column. I think that it's because the program use this column to calculate time.. I tried to modify the code but I'm not so able.... can you help me?

  43. #43
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    Delete this line from reset macro
    Please Login or Register  to view this content.
    not in use in this version
    Last edited by nigelog; 11-22-2018 at 07:22 AM.

  44. #44
    Registered User
    Join Date
    11-09-2018
    Location
    Parma, Italy
    MS-Off Ver
    Windows 7 Professional
    Posts
    19

    Re: Multiple Timer

    perfect! thanks

  45. #45
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Multiple Timer

    No Problem, glad it sorted

    If that has resolved your question Luke can you mark thread as solved - go to first post, edit, status ( change to solved)

+ 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. 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
  2. [SOLVED] Multiple Timer for Experiment
    By costelveaceslav in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-25-2014, 02:08 AM
  3. Multiple Timer Running
    By Lightnessg1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2013, 02:29 PM
  4. [SOLVED] Multiple Countdown/Timer
    By sdheckler in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-04-2013, 06:02 PM
  5. Replies: 1
    Last Post: 12-12-2012, 08:46 PM
  6. How to create multiple timer in vba?
    By missyQ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2007, 11:26 AM
  7. [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