none
Unable to record time of events in a game RRS feed

  • General discussion

  • Hello everyone,

    I have this little project where I'd like to get some stats of my kid team. I set up a little timer in excel to be able to record when certain events occur during a game. For example, I'd like to record that player1 scored after 25 secs from position (x,y) in the rink. The timer works fine, but I'm unable to record nothing while the timer is on... This is the code I have for the timer:

    Private a As Boolean

    Private Sub StartTimer_Click()
        a = True
        Do While a
        Application.Wait (Now + #12:00:01 AM#)
        DoEvents
        Worksheets("DataEntry").Cells(1, "A") = Format(DateAdd("s", 1, Worksheets("DataEntry").Cells(1, "A")), "hh:mm:ss")
        Loop
    End Sub

    Private Sub StopTimer_Click()
        a = False
    End Sub

    Private Sub Reset_Click()
        Worksheets("DataEntry").Cells(1, "A") = "00:00:00"
    End Sub

    And thi is an image of the sheet: (I'm not allowed to post any image as for now, hopefully I can add it at a later stage:

    I'd like to write a player name and authomatically insert the time of the game at which the event happened (25 secs for the example, which I introduced manually). The coordinates are less important right now, as I just started the project and if I dont fix this issue I wont be able to record any time. As soon as I start typing a name, the timer stops. Needless to say, the time value should not change in the event row, but keep on counting on the timer.

    Any suggestion to solve this issue? Thanks in advanced for your kind disposition.

    best

    mik

    Tuesday, July 16, 2019 2:11 PM