RLD = "R" & LDéb
Cel.Offset(, -5).FormulaR1C1 = "=IF(RC[-1]=0,RC[-3],RC[-1])-IF(" _
& RLD & "C[-4]=0," & RLD & "C[-2]," & RLD & "C[-4])"
Sub CalculSommeHeuresParJour()
Dim RngSpC As Range, Cel As Range, LDéb, RLD As String
With ActiveSheet.[P6].Resize(ActiveSheet.[M1000000].End(xlUp).Row - 5)
.FormulaR1C1 = "=1/(RC3<>R[1]C3)"
Set RngSpC = .SpecialCells(xlCellTypeFormulas, 1).Offset(, -3)
.Resize(, 2).ClearContents: End With
LDéb = 6
For Each Cel In RngSpC
If Intersect(Columns(3), Cel.EntireRow).Value <>...
=SI($C14=$C13;"";SOMME.SI($C$5:$C13;$C13;$I$5:$I13))
Sub CalculSommeHeuresParJour()
Dim RngSpC As Range, Cel As Range, LDéb
With Feuil1.[M5].Resize(Feuil1.[M1000000].End(xlUp).Row - 4)
.FormulaR1C1 = "=1/(RC3<>R[1]C3)"
Set RngSpC = .SpecialCells(xlCellTypeFormulas, 1)
.Resize(, 2).ClearContents: End With
LDéb = 5
For Each Cel In RngSpC
If Intersect(Columns(3), Cel.EntireRow).Value <> "" Then
With Cel
.NumberFormat = "h:mm": .Font.Bold = True: .HorizontalAlignment = xlCenter: .VerticalAlignment = xlCenter
.FormulaR1C1 = "=SUM(R" & LDéb & "C[-4]:RC[-4])": End With
With Cel.Offset(, 1)
.NumberFormat = "0.00": .Font.Bold = True: .HorizontalAlignment = xlCenter: .VerticalAlignment = xlCenter
.FormulaR1C1 = "=RC[-1]*24": End With
End If
LDéb = Cel.Row + 1: Next Cel
End Sub
RLD = "R" & LDéb
Cel.Offset(, -5).FormulaR1C1 = "=IF(RC[-1]=0,RC[-3],RC[-1])-IF(" _
& RLD & "C[-4]=0," & RLD & "C[-2]," & RLD & "C[-4])"
Sub CalculSommeHeuresParJour()
Dim RngSpC As Range, Cel As Range, LDéb, RLD As String
With ActiveSheet.[P6].Resize(ActiveSheet.[M1000000].End(xlUp).Row - 5)
.FormulaR1C1 = "=1/(RC3<>R[1]C3)"
Set RngSpC = .SpecialCells(xlCellTypeFormulas, 1).Offset(, -3)
.Resize(, 2).ClearContents: End With
LDéb = 6
For Each Cel In RngSpC
If Intersect(Columns(3), Cel.EntireRow).Value <> "" Then
RLD = "R" & LDéb
With Cel
.NumberFormat = "h:mm": .Font.Bold = True: .HorizontalAlignment = xlCenter: .VerticalAlignment = xlCenter
.FormulaR1C1 = "=SUM(" & RLD & "C[-4]:RC[-4])": End With
With Cel.Offset(, 1)
.NumberFormat = "0.00": .Font.Bold = True: .HorizontalAlignment = xlCenter: .VerticalAlignment = xlCenter
.FormulaR1C1 = "=RC[-1]*24": End With
Cel.Offset(, -5).FormulaR1C1 = "=IF(RC[-1]=0,RC[-3],RC[-1])-IF(" _
& RLD & "C[-4]=0," & RLD & "C[-2]," & RLD & "C[-4])"
End If
LDéb = Cel.Row + 1: Next Cel
End Sub