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 = x1
'Totaux pour MEC
Cells(x1, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMec" & M & "=7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*((ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColTypeMec" & M & "<>""Panne TI""))),""SO"",SUMPRODUCT((ColUMec" & M & "=7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*((ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColTypeMec" & M & "<>""Panne TI"")))"
Cells(x2, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMec" & M & "=7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*(ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMec" & M & "<>""Panne TI"")*(ColE2Mec" & M & "=""ý""))),""SO"",SUMPRODUCT((ColUMec" & M & "=7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*(ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMec" & M & "<>""Panne TI"")*(ColE2Mec" & M & "=""ý"")))"
Cells(x3, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMec" & M & "<>7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*(ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMec" & M & "<>""o""))),""SO"",SUMPRODUCT((ColUMec" & M & "<>7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*(ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMec" & M & "<>""Panne TI"")))"
Cells(x4, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMec" & M & "<>7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*(ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColE2Mec" & M & "=""ý""))),""SO"", SUMPRODUCT((ColUMec" & M & "<>7)*(ColGetMec" & M & "=""" & G & """)*(ColCEMec" & M & "=""" & C & """)*(ColTypeMec" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMec" & M & "<>""Panne TI"")*(ColE2Mec" & M & "=""ý"")))"
'Totaux pour MES
Cells(x5, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMes" & M & "=7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*((ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColTypeMes" & M & "<>""Panne TI""))),""SO"",SUMPRODUCT((ColUMes" & M & "=7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*((ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT""))*(ColTypeMes" & M & "<>""Panne TI"")))"
Cells(x6, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMes" & M & "=7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*(ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMes" & M & "<>""Panne TI"")*(ColE2Mes" & M & "=""ý""))),""SO"",SUMPRODUCT((ColUMes" & M & "=7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*(ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMes" & M & "<>""Panne TI"")*(ColE2Mes" & M & "=""ý"")))"
Cells(x7, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMes" & M & "<>7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*(ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMes" & M & "<>""o""))),""SO"",SUMPRODUCT((ColUMes" & M & "<>7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*(ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMes" & M & "<>""Panne TI"")))"
Cells(x8, i).Formula = "=IF(ISERROR(SUMPRODUCT((ColUMes" & M & "<>7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*(ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColE2Mes" & M & "=""ý""))),""SO"", SUMPRODUCT((ColUMes" & M & "<>7)*(ColGetMes" & M & "=""" & G & """)*(ColCEMes" & M & "=""" & C & """)*(ColTypeMes" & M & "=""Ouvrage Neuf ou Refonte BT"")*(ColTypeMes" & M & "<>""Panne TI"")*(ColE2Mes" & M & "=""ý"")))"
Next M
i = 2
x1 = x1 + 15
x2 = x2 + 15
x3 = x3 + 15
x4 = x4 + 15
x5 = x5 + 15
x6 = x6 + 15
x7 = x7 + 15
x8 = x8 + 15