M
McManCSU
Basically I am making a stopwatch that makes a graph to track time
progress. I want to use the onKey function to act as a funciton that
will stop the timer, save the time, reset time to 0, then start it
again. I have all the methods working, but I cant seem to get the
onKey to recognize when I press the key.
I want to have the space bar as the key, but it changes the cell's
contents everytime (plus i dont know if i can use SPACE as a key). How
should I implement it first of all? It only needs to run when the
clock is actually running, so I dont think that an event on opening the
sheet is needed. Can i do something like this?
Do While Not Range("haltClock")
Range("clockArea").Value = (time() - clockStart)
If Not Range("haltTimer") Then
Range("timerArea").Value = (time() - timerStart)
End If
Application.OnKey "{ENTER}", "boardDone"
DoEvents
Loop
BTW this is what i have, but it doesnt work...
progress. I want to use the onKey function to act as a funciton that
will stop the timer, save the time, reset time to 0, then start it
again. I have all the methods working, but I cant seem to get the
onKey to recognize when I press the key.
I want to have the space bar as the key, but it changes the cell's
contents everytime (plus i dont know if i can use SPACE as a key). How
should I implement it first of all? It only needs to run when the
clock is actually running, so I dont think that an event on opening the
sheet is needed. Can i do something like this?
Do While Not Range("haltClock")
Range("clockArea").Value = (time() - clockStart)
If Not Range("haltTimer") Then
Range("timerArea").Value = (time() - timerStart)
End If
Application.OnKey "{ENTER}", "boardDone"
DoEvents
Loop
BTW this is what i have, but it doesnt work...