Keith Mc 001
New Member
- Joined
- May 13, 2023
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
BACKGROUND & CONTEXT: When the user hits a certain button, a macro is to begin by displaying (within a loop) the first of a sequence of random calculations (e.g., multiplication or addition) with two operands in the two cells immediately above the active cell in which the user is to enter their answer. When this loop begins, the timer allows the elapsed time to display continuously in another cell in the active worksheet. I want the elapsed time (& hence the macro) to PAUSE when the user starts hitting keystrokes & RESUME when the user hits the Enter key. Without this feature, while the macro is running I can't see the keystrokes that are being pressed until the whole number is entered & the timer keeps re-calculating the elapsed time, so it that continues to increase while the user's answer hasn't been finalized with the Enter key. I don't want the key pressing actions to form part of the elapsed time. The elapsed time is to increase again once the user has entered their answer (via the Enter key).
While the macro is on pause, the relevant calculation & the user's answer will be recorded in a TABLE (with an index). The macro should then resume by displaying another random calculation. The macro will loop through successive calculations & finally end after either (1) a prescribed time (during which time there may be dozens of calculations displayed & answered or (2) when a certain number of calculations have been answered.
WHAT I WANT HELP WITH is to be able to PAUSE THE MACRO (& hence the elapsing of time calculated from successive values of the timer, enabling also the user's non-Enter keystrokes to be displayed) UNTIL they hit the ENTER key to confirm their answer, at which point in time THE MACRO SHOULD RESUME. This sequence is to be repeated (with a new calculation) until a prescribed condition is met. It's ONLY the PAUSE & RESUME & the RELEVANT TRIGGERS I need help with.
While the macro is on pause, the relevant calculation & the user's answer will be recorded in a TABLE (with an index). The macro should then resume by displaying another random calculation. The macro will loop through successive calculations & finally end after either (1) a prescribed time (during which time there may be dozens of calculations displayed & answered or (2) when a certain number of calculations have been answered.
WHAT I WANT HELP WITH is to be able to PAUSE THE MACRO (& hence the elapsing of time calculated from successive values of the timer, enabling also the user's non-Enter keystrokes to be displayed) UNTIL they hit the ENTER key to confirm their answer, at which point in time THE MACRO SHOULD RESUME. This sequence is to be repeated (with a new calculation) until a prescribed condition is met. It's ONLY the PAUSE & RESUME & the RELEVANT TRIGGERS I need help with.