Sub Formules()
Dim DerLig As Long, DerLig_Donnees As Long, i As Long
Dim Decalage_R As Long, Decalage_S As Long
Application.ScreenUpdating = False
DerLig = Range("P" & Rows.Count).End(xlUp).Row
DerLig_Donnees = Range("B" & Rows.Count).End(xlUp).Row
Range("R9:S" & DerLig).Clear
Decalage_R = 7
Decalage_S = 1
For i = 9 To DerLig Step 6
Range(Cells(i, "R"), Cells(i + 5, "R")).FormulaR1C1 = "=INDEX(R1C2:R" & DerLig_Donnees & "C14,MATCH(RC16,R1C2:R" & DerLig_Donnees & "C2,0),ROW()-" & Decalage_R & ")"
Range(Cells(i, "S"), Cells(i + 5, "S")).FormulaR1C1 = "=INDEX(R1C2:R" & DerLig_Donnees & "C14,MATCH(RC16,R1C2:R" & DerLig_Donnees & "C2,0),ROW()-" & Decalage_S & ")"
Range(Cells(i + 3, "R"), Cells(i + 3, "S")).NumberFormat = "0.0%"
Range(Cells(i, "P"), Cells(i + 5, "S")).Borders().Weight = xlThin
If Cells(i - 1, "R").Interior.Color <> RGB(222, 235, 246) Then
Range(Cells(i, "P"), Cells(i + 5, "S")).Interior.Color = RGB(222, 235, 246)
Else
Range(Cells(i, "P"), Cells(i + 5, "S")).Interior.Color = RGB(226, 239, 217)
End If
Decalage_R = Decalage_R + 6
Decalage_S = Decalage_S + 6
Next i
End Sub