Option Explicit
Private Sub CommandButton1_Click()
Dim i As Integer
Range("A1").Value = 0
For i = 1 To 30
Range("A1").Value = Range("A1").Value + 1
Application.Wait [now()+"00:00:00.1"]
Next
End Sub
Private Sub CommandButton1_Click()
Calculate
Range("A3").Value = Range("A2").Value '<---(1)
Gene = 0 '<---(2)
Do
Calculate
DoEvents
If Gene = 1 Then Exit Do
If Range("A1").Value > 50 Then Exit Do
Loop
End Sub
Private Sub CommandButton2_Click()
Gene = 1
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Gene = 1
End Sub
Dim i As Integer
For i = 0 To 1000
Range("E52").Value = Range("E52").Value + Range("L60").Value / 20 - Range("L61").Value
Application.Wait [now()+"00:00:00.05"]