Public i
[COLOR="Red"]Private Sub CommandButton1_Click()[/COLOR]
Instruction 1
....
For i = 0 To 200
Sheets("Graphecaract").Cells(2, 5) = i
[COLOR="blue"]FRM_progression.Show[/COLOR]
If i = 0 Then q = R2 Else q = t2(i - 1, 1) * 10 ^ 6
'Sheets("Graphecaract").Cells(1, 6) = i
P1 = t1(i, 2) * 10 ^ 6
ifpo = Istn
testcarac = 0
While ifpo > Ifn
'MsgBox ("nouveauwhileifposupIfn")
q = q - 0.0001 * q
If q < 1 Then GoTo line1
S = Sqr(P1 ^ 2 + q ^ 2)
Isp = S / (Sqr(3) * U)
If P1 = 0 Then phi = PI / 2 Else phi = Atn(q / P1)
E = Sqr((U + lambda * Isp * w * Sin(phi)) ^ 2 + (lambda * Isp * w * Cos(phi)) ^ 2) ' force éléctromotrice
Dim Etest
Etest = Sheets("Graphecaract").Cells(4, 8)
Etest = Etest * Un * 1000
If E > Etest Then
A1 = coeffloga1
B1 = coeffloga0
Y = E / (Un * 1000)
ifr = Exp((Y - B1) / A1)
Else
Ap = coeffpoly3
Bp = coeffpoly2
Cp = coeffpoly1
Dp = coeffpoly0
Dp = Dp - (E / (Un * 1000))
ifr = resolvequation(Ap, Bp, Cp, Dp)
'Sheets("Graphecaract").Cells(3, 6) = Dp
'Sheets("Graphecaract").Cells(4, 6) = E
'Sheets("Graphecaract").Cells(5, 6) = Un
'Sheets("Graphecaract").Cells(2, 6) = ifr
'MsgBox ("courbenom")
End If
ai = Atn(lambda * Isp * w * Cos(phi) / (U + lambda * Isp * w * Sin(phi))) ' angle interne
ifpo = Sqr((ifr + alpha * Isp * Sin(ai + phi)) ^ 2 + (alpha * Isp * Cos(ai + phi)) ^ 2) ' courant inducteur réel
Q1 = q
'Sheets("Graphecaract").Cells(5, 9) = ifpo
'Sheets("Graphecaract").Cells(6, 9) = Ifn
Wend
t1(i, 1) = Q1 * 10 ^ -6
t1(i, 2) = P1 * 10 ^ -6
Next i
[COLOR="Blue"]FRM_progression.Hide[/COLOR]
...
[COLOR="red"]End Sub[/COLOR]