A
Andrew
For the code below, if I leave the worksheet alone, the code runs
fine. If I activate a cell by selecting it, and leave it active, the
code doesn't complete. How do I write a code which will complete the
code regardless of what is happening on the sheet?
thanks
Private Sub CommandButton1_Click()
For k = 1 To 10
Cells(k, 1) = k
Start = Timer
Do While Abs(Timer - Start) <= 1 'Waiting 1 sec
DoEvents
Loop
Cells(k, 2) = k + 1
Next
End Sub
fine. If I activate a cell by selecting it, and leave it active, the
code doesn't complete. How do I write a code which will complete the
code regardless of what is happening on the sheet?
thanks
Private Sub CommandButton1_Click()
For k = 1 To 10
Cells(k, 1) = k
Start = Timer
Do While Abs(Timer - Start) <= 1 'Waiting 1 sec
DoEvents
Loop
Cells(k, 2) = k + 1
Next
End Sub