Sub LancerCalcul()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
With shFrequentation
.EnableFormatConditionsCalculation = False
If .Range("E4") = "Ligne_1" Then
With .Range("E1")
.Interior.Color = RGB(0, 100, 200)
.Font.Color = RGB(255, 255, 255)
.Font.Bold = True
End With
ElseIf .Range("E4") = "Ligne_6" Then
With .Range("E1")
.Interior.Color = RGB(0, 100, 200)
.Font.Color = RGB(255, 255, 255)
.Font.Bold = True
End With
End If
.Range("Donnees").ClearContents
With .Range("D9")
.Formula2R1C1 = "=IFERROR(IF(COUNTA([Ex_09_2021.xlsx]RawData!R3C2:R200000C2)-SUMPRODUCT((WEEKDAY([Ex_09_2021.xlsx]RawData!R3C2:R200000C2)<7)*1)>0,SUMIFS([Ex_09_2021.xlsx]RawData!C12,[Ex_09_2021.xlsx]RawData!C7,R4C8,[Ex_09_2021.xlsx]RawData!C10,RC3,[Ex_09_2021.xlsx]RawData!C2,"">=""&R4C4,[Ex_09_2021.xlsx]RawData!C2,""<=""&R5C4,[Ex_09_2021.xlsx]RawData!C3,"">=""&R8C,[Ex_09_2021.xlsx]RawData!C3,""<=""&R8C[1]),0),"""")"
.Copy
End With
.Range("Donnees").PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
.Range("A1").Select
.EnableFormatConditionsCalculation = True
.Calculate
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub