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
|
Dim c As Long, a As Long, b As Long, t As Long
Dim Somme As Long,
Dim Som As Long,
Dim toto As String, titi As String
Dim d
Somme = 0
Som = 0
d = "avril" & Format(Date, "yyyy")
If FeuilleExiste(ThisWorkbook, d) Then
For i = 5 To Sheets(d).Cells(Rows.Count, 13).End(xlUp).Row
For j = 5 To Sheets(d).Cells(Rows.Count, 24).End(xlUp).Row
toto = Sheets(d).Cells(i, 13).Value
titi = Sheets(d).Cells(i, 24).Value
With Sheets(d)
For b = 5 To 500 '.Cells(Rows.Count, 13).End(xlUp).Row
If toto = Client And titi = Closed Then
Som = Som + .Cells(b, 16).Value
Somme = Somme + .Cells(b, 20).Value
End If
Next b
With Sheets("Récap")
.Cells(6, 3) = Somme
.Cells(6, 4) = Som
End With
Next j
Next i
End With
End If
End Sub |
Partager