For Each G In Array("NO", "EST")
For Each C In Array("CE1", "CE2")
For Each M In Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre")
i = i + 1
ActiveWindow.ScrollRow = x4
'Calculs des totaux pour le 400KV et autres
Cells(x1, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*((ColType" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColType" & M & "<>""Panne TI""))),""SO"",SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*((ColType" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColType" & M & "<>""Panne TI"")))"
Cells(x2, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")*(ColE2" & M & "=""ý""))),""SO"",SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")*(ColE2" & M & "=""ý"")))"
Cells(x3, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""o""))),""SO"",SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")))"
Cells(x4, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColE2" & M & "=""ý""))),""SO"", SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")*(ColE2" & M & "=""ý"")))"
Next M
i = 2
x1 = x1 + 7
x2 = x2 + 7
x3 = x3 + 7
x4 = x4 + 7
Next C
Next G
x1 = 33
x2 = 34
x3 = 35
x4 = 36
For Each G In Array("SO")
For Each C In Array("CE1", "CE2", "CE3")
For Each M In Array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre")
i = i + 1
ActiveWindow.ScrollRow = x4
'Calculs des totaux pour le 400KV et autres
Cells(x1, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*((ColType" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColType" & M & "<>""Panne TI""))),""SO"",SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*((ColType" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColType" & M & "<>""Panne TI"")))"
Cells(x2, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")*(ColE2" & M & "=""ý""))),""SO"",SUMPRODUCT((ColU" & M & "=7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")*(ColE2" & M & "=""ý"")))"
Cells(x3, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""o""))),""SO"",SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")))"
Cells(x4, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColE2" & M & "=""ý""))),""SO"", SUMPRODUCT((ColU" & M & "<>7)*(ColGet" & M & "=""" & G & """)*(ColCE" & M & "=""" & C & """)*(ColType" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColType" & M & "<>""Panne TI"")*(ColE2" & M & "=""ý"")))"
Next M
i = 2
x1 = x1 + 7
x2 = x2 + 7
x3 = x3 + 7
x4 = x4 + 7
Next C
Next G