Dim M As Long, A As Long, C As Long, F10Précéd As String, F10Décemb As String
M = Month(.[F9].Value): A = Right$(.[F9].Value, 2)
F10Décemb = "'12-" & Format(A - 1, "00") & "'!RC6"
C = 19 - M
If M > 2 Then
F10Précéd = "'" & Format(M - 2, "00") & "-" & Format(A, "00") & "'!RC6"
.Cells(10, C).FormulaR1C1 = "=SUM(RC6:RC[-1]," & F10Précéd & "," & F10Décemb & ")"
Else
.Cells(10, C).FormulaR1C1 = "=SUM(RC6:RC[-1]," & F10Décemb & ")"
End If
End Sub