1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Private Sub Calucler_Click()
Dim couttotal As String
B = nbmensualité
T = (taux / 100)
Z = 2600 * T 'Val(montantprêt) * T
Y = Round((Z / 12), 6)
J = 1 - (1 + T) / (12)
K = ((J ^ (-B)))
couttotal = Str(K)
couttotal = Replace(couttotal, ".", ",")
'met un nombre sous la forme 0,00
couttotal = Euro(couttotal)
MsgBox (couttotal)
End Sub
Public Function Euro(H9$)
Dim EU$, EU2$, EU3$, EU4$, EU5$
Dim EU1 As Integer
EU$ = H9$
EU1 = InStr(EU$, ",")
If EU1 = 1 Then EU$ = "0" + EU$: EU1 = 2
If EU1 <> 0 Then
EU$ = EU$ + "0"
EU2$ = Left$(EU$, EU1 - 1): EU3$ = Mid$(EU$, EU1 + 1, 2)
If EU2$ = " " Then EU2$ = "0"
EU$ = EU2$ + "," + EU3$
Else
EU$ = EU$ + ",00"
End If
Euro = EU$
End Function |
Partager