ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Move Around Excel While VBA code is running. (https://www.excelbanter.com/excel-programming/350590-move-around-excel-while-vba-code-running.html)

Kryer

Move Around Excel While VBA code is running.
 
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



All times are GMT +1. The time now is 08:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com