Move Around Excel While VBA code is running.

K

Kryer

I am trying to figure out what code I can insert in here that would allow me
to work with this workbook while this code is running. I came across a snipet
and then my computer shut down as i was in the middle of trying to take down
the example but it had something to do with a Do While.... DoEvent..
statement. Can anyone help me with this please.
Sub settime()

MsgBox "IF YOU WISH TO START OVER, CLICK EXCEL AND HIT THE ESC KEY"
Application.WindowState = xlMinimized

Range("B3").Value = Time()
Call counttime

End Sub
----------------------------------------------
Sub counttime()

On Error GoTo handleCancel
Application.EnableCancelKey = xlErrorHandler
If Range("B5").Value > TimeValue("00:07:01") Then Exit Sub

Do Until Range("B5").Value > TimeValue("00:07:00")
Range("B4").Value = Time()
If Range("B5").Value < TimeValue("00:04:00") And Range("B5").Value >
TimeValue("00:03:59") Then
Application.WindowState = xlNormal
msg = MsgBox("YOU ARE AT 4 MINS NOW", vbOKCancel)
If msg = vbCancel Then Exit Sub
If msg = vbOK Then
Application.WindowState = xlMinimized
End If

End If
Loop
'Application.WindowState = xlNormal
UserForm1.Show

handleCancel:
MsgBox "You Have Requested To Start Over"

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top