VBA Code:
Option Explicit
Public Function puissance2(Taux_CPrincpal As Double) As Double
On Error Resume Next
Dim x As Double
puissance2 = Taux_CPrincpal
For x = 2 To 40
puissance2 = (puissance2 + Application.Power(Taux_CPrincpal, x))
Next x
End Function
Public Function deversement(Charge_Centre_Principal, Centre1 As String, Vlrange1 As Range, Vlcolone As Double, TauxCP As Double) As Double
Dim y As Double
For y = 2 To 40
deversement = (-Charge_Centre_Principal * Application.WorksheetFunction.VLookup(Centre1, Vlrange1, Vlcolone, 0)) * (1 + puissance2(TauxCP))
Next y
End Function
I have this code above for calculate a personnel function,
I have a problem that every time when I close the file and open it again , I see that the loop start from zero
and i see in the top of the file , that the File start calculating after few minutes , the Real result appear
Is that any way to make the looping stop if the result appear ? or anyway to make the loop stop and not refresh every time
Thank you
Note: The file is In French Language, and It's very heavy (64 Mb)