tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,832
- Office Version
- 365
- 2019
- Platform
- Windows
In the code below, I have added DoEvents, so the user can do something whilst the loop takes place.
However, when the code is running, if I select a cell on the worksheet and change its value, the code stops.
How can I allow the user to change a value on the worksheet without the code stopping?
Thanks
Code:
Option Explicit
Sub Test()
Dim i As Long
For i = 1 To 10000
Sheet1.Cells(i, 1).Value = i
Application.Wait (Now + TimeValue("0:00:01"))
DoEvents
Next i
End Sub
However, when the code is running, if I select a cell on the worksheet and change its value, the code stops.
How can I allow the user to change a value on the worksheet without the code stopping?
Thanks