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
| Private Sub ValeursActuelles_Click()
Dim CelluleCourante As Range
Dim Debloc, Frais, IntInt, Ech, NumEch, Ass
Worksheets("tableau amortiss").Activate
Set CelluleCourante = ActiveSheet.Range("A61")
Do While Not IsEmpty(CelluleCourante) = True
Debloc = CelluleCourante.Offset(0, 1).Value
Frais = CelluleCourante.Offset(0, 2).Value
IntInt = CelluleCourante.Offset(0, 5).Value
Ech = CelluleCourante.Offset(0, 8).Value
NumEch = CelluleCourante.Offset(0, 10).Value
Ass = CelluleCourante.Offset(0, 6).Value
'Valeur actuelle hors frais et hors assurance
CelluleCourante.Offset(0, 12).Value = "=SI(" & Debloc & "<> 0 ;" & Debloc & ";SI(" & Ech & "<> 0;" & Ech & "*(1+$Q$34)^(-" & NumEch & ");0))"
'Valeur actuelle hors assurance
CelluleCourante.Offset(0, 13).Value = "=SI(" & Debloc & "<> 0 ;" & Debloc & ";SI(" & Frais & "<> 0 ;" & Frais & ";SI(" & Ech & "<> 0 ;" & Ech & "*(1+$Q$22)^(-(" & NumEch & "/12));0)))"
'Valeur actuelle assurance comprise
CelluleCourante.Offset(0, 14).Value = "=SI(" & Debloc & "<> 0 ;" & Debloc & ";SI(" & Frais & "<> 0 ;" & Frais & ";SI(" & Ech & "<> 0 ;" & Ech & "*(1+$Q$42)^(-(" & NumEch & "/12))+" & Ass & ";0)))"
If CelluleCourante.Offset(0, 1).Value <> 0 Then
End If
Set CelluleCourante = CelluleCourante.Offset(1, 0)
Loop
End Sub |
Partager