
Private Sub CommandButton1_Click()
Dim FineR As Long
Dim r As Long
With Sheets("Foglio1")
FineR = .Cells(Rows.Count, 1).End(xlUp).Row
For r = 1 To 22
TextBox1 = Cells(r, 1).Value & " " & r
DoEvents
Application.Wait (Now + TimeValue("0:00:1"))
Next r
End With
MsgBox "Fine"
End Sub |
Dim myStop As Boolean
Private Sub CommandButton1_Click()
Dim FineR As Long
Dim r As Long
With Sheets("Foglio1")
r = 1
Do Until Cells(r, 1) = "" Or myStop = True
TextBox1 = Cells(r, 1).Value & " " & r
DoEvents
Application.Wait (Now + TimeValue("0:00:1"))
r = r + 1
Loop
End With
MsgBox "Fine"
myStop = False
End Sub
Private Sub CommandButton2_Click()
myStop = True
End Sub |
