提出问题提出问题
 

已答复How to use ESC key to break the loop?

  • 2009年7月3日 0:31AusJT 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    When ESC key press on 1st time, waitTime disable as graph just scroll without the delay.
    When ESC press the 2nd time, Error message "Code execution has been interrupted" > [Continue], [End], [Debug]   
    Would like when ESC key press, it will stop the Graph display loop and back to the UserForm.

    Do While jj < ii + 1
    Application.OnKey "{ESC}", "goto BreakHandler"
    Sheets(Graph(jj)).Select
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 5
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    jj = jj + 1
    If jj >= ii Then jj = 1
    Loop

    • 已编辑AusJT 2009年7月9日 1:40
    • 已编辑AusJT 2009年7月8日 23:19
    •  

答案

全部回复