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
| Sub synthesedonnées()
Dim col As Long
With Sheets("SYNTHESE")
Dim LigneCalcul
For Each LigneCalcul In Range("A15:A650")
If LigneCalcul <> "" Then
'----------------------------
For col = 6 To 118 Step 14 'DN = 118
.Range(Cells(15, col), Cells(650, col + 12)).Value = Range(Cells(15, col), Cells(650, col + 12)).Value
.Range(Cells(15, col), Cells(650, col + 12)).FormulaR1C1 = _
"=SUMPRODUCT((R1C<=Mois_Reporting)*(Tb_B_COMPTE=RC1)*(Tb_B_ANNEE=YEAR(R7C))*(Tb_B_MOIS=R2C)*(Tb_B_BUDGETREEL=RC4)*(Tb_B_POSTE=RC2)*(Tb_B_BQ=""OUI"")*(Tb_B_DEBITCREDIT))"
.Range(Cells(15, col), Cells(650, col + 12)).Value = Range(Cells(15, col), Cells(650, col + 12)).Value
Next col
End If
Next LigneCalcul
End With
End Sub |
Partager