question

SahraouiKhaledIbnElWalid-9866 avatar image
0 Votes"
SahraouiKhaledIbnElWalid-9866 asked

storing function vba values

Hello
I created a custom vba function,
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 90
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
On Error Resume Next
deversement = (-Charge_Centre_Principal Application.WorksheetFunction.VLookup(Centre1, Vlrange1, Vlcolone, 0)) (1 - puissance2(TauxCP))
End Function

so when the function ends I see my the results and it's very well,
but when i close and open again the file I see that the values nevers stored and the function reclaculate until I get the Result,
Is there any way to make the Excel file with Vba code save and storing the values even after closing the file ?

office-vba-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers