Sub Calcul()
Dim chaine$, x, y, z, w, T%, ix%, iy%, iz%, iw%, L%, reste, Go%
Range("A2:E1000").ClearContents: chaine = ""
x = 2.37: y = 7.39: z = 10.98: w = 11.09: T = 2740: L = 2: Go = 0
For ix = 1 To Int(T / x)
Application.StatusBar = "Progression : " & Format(ix / Int(T / x), "0.00%")
For iy = 1 To Int(T / y)
For iz = 1 To Int(T / z)
For iw = 1 To Int(T / w)
reste = T - ix * x - iy * y - iz * z - iw * w
If reste < 0 Then Exit For ' Si le reste est négatif, inutile de continuer au delà de cette valeur de iw
If reste = 0 Then
Cells(L, 1) = ix: Cells(L, 2) = iy: Cells(L, 3) = iz: Cells(L, 4) = iw: Cells(L, 5) = ix * x + iy * y + iz * z + iw * w
L = L + 1
Go = 1 ' Si Go=1 on sort des boucles
Exit For
End If
Next iw
If Go = 1 Then Exit For
Next iz
If Go = 1 Then Exit For
Next iy
Go = 0
Next ix
Fin:
Application.StatusBar = ""
End Sub