PDA

View Full Version : Quick help please; wait for enter



Ago
02-26-2008, 12:26 PM
im working on a sheet that should be used in a education.
the macro works fine but i need to slow it down, how can i make the macro wait for the user to press enter?

help please!

mikerickson
02-26-2008, 12:56 PM
MsgBox "Press Enter when ready to proceed"

Ago
02-26-2008, 01:04 PM
thanks but a msgbox will block parts of the sheet.
the point with the "wait" is to let me explain whats happening on the sheet and when im done press enter (or other button) to proceed.
a msgbox will only block and i have to move it out of the way.

int there a way to write something like

while keydown <> enter
do nothing
wend

Bob Phillips
02-26-2008, 03:01 PM
Dim nTime As Double

Sub StartCode()

'some code to get started

nTime = Now + TimeSerial(0, 0, 15) '1 hour on
Application.OnTime nTime, "QuitMe"

End Sub

Sub QuitMe()

MsgBox "abandoning ..."
End Sub

Sub ButtonCode()


Application.OnTime nTime, "QuitMe", , False

'rest of your code

End Sub