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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| Sub Bouton1085_Clic()
On Error GoTo Err
Dim Limite As Integer
Dim debut As Integer
Dim i As Integer
Dim DRE_T As Double
Dim SHL_T As Double
Dim CBA_T As Double
Dim AGA_T As Double
Dim SMA_T As Double
Dim CMA_T As Double
Dim FV As Double
Dim KMS As Double
debut = InputBox("A partir de quelle ligne voulez calculer les montants?")
Limite = InputBox("Jusqu'à quelle ligne voulez calculer les montants?")
For i = debut To Limite
Select Case (Cells(i, "v").Value)
Case ("OLD")
DRE_T = 77.57
SHL_T = 56.99
CBA_T = 56.99
AGA_T = 71.27
SMA_T = 35.72
CMA_T = 30.11
FV = 17
KMS = 0.45
Case ("NEW")
DRE_T = 76.55
SHL_T = 56.36
CBA_T = 56.36
AGA_T = 70.16
SMA_T = 34.07
CMA_T = 28.38
FV = 18
KMS = 0.48
Case (Default)
MsgBox "La case Nouveau Contrat n'existe pas ou n'est pas renseigné!\n Voulez-vous le renseigner?", vbCritical = vbYesNo, "attention"
End Select
'DRE
If Cells(i, "c").Value = "DRE" Then
Cells(i, "y").Value = (Cells(i, "m").Value * DRE_T) + (Cells(i, "n").Value * FV) + (Cells(i, "o").Value * KMS) + Cells(i, "p").Value
End If
'SHL
If Cells(i, "c").Value = "SHL" Then
Cells(i, "y").Value = (Cells(i, "m").Value * SHL_T) + (Cells(i, "n").Value * FV) + (Cells(i, "o").Value * KMS) + Cells(i, "p").Value
End If
'CBA
If Cells(i, "c").Value = "CBA" Then
Cells(i, "y").Value = (Cells(i, "m").Value * CBA_T) + (Cells(i, "n").Value * FV) + (Cells(i, "o").Value * KMS) + Cells(i, "p").Value
End If
'AGA
If Cells(i, "c").Value = "AGA" Then
Cells(i, "y").Value = (Cells(i, "m").Value * AGA_T) + (Cells(i, "n").Value * FV) + (Cells(i, "o").Value * KMS) + Cells(i, "p").Value
End If
'SMA
If Cells(i, "c").Value = "SMA" Then
Cells(i, "y").Value = (Cells(i, "m").Value * SMA_T) + (Cells(i, "n").Value * FV) + (Cells(i, "o").Value * KMS) + Cells(i, "p").Value
End If
'CMA
If Cells(i, "c").Value = "CMA" Then
Cells(i, "y").Value = (Cells(i, "m").Value * CMA_T) + (Cells(i, "n").Value * FV) + (Cells(i, "o").Value * KMS) + Cells(i, "p").Value
End If
Next i
Err:
'Gére les erreurs
Select Case Err.Number
Case Else: MsgBox "Erreur in !"
End Select
End Sub |
Partager