Sub FormuleEBITDA()
Dim L As Long, LDéb1 As Long, LDéb2 As Long
DernLigne = Columns(1).Find("Chiffre d'affaires net").Row
LDéb1 = 2: LDéb2 = 2
For L = 2 To DernLigne
If Cells(L, 1) <> "" Then
If Cells(L - 1, 1) <> "" Then
Cells(L, 8).FormulaR1C1 = "=SUBTOTAL(9,R" & LDéb1 & "C:R[-2]C)"
LDéb1 = L + 1
Else
Cells(L, 8).FormulaR1C1 = "=SUBTOTAL(9,R" & LDéb2 & "C:R[-1]C)"
LDéb2 = L + 1: End If
ElseIf Cells(L, 3) <> "" And Not Cells(L, 3) Like "681*" _
And Not Cells(L, 3) Like "781*" And Cells(L, 3) <> 777010 _
And Cells(L, 3) <> 775217 And Cells(L, 3) <> 675217 _
And Cells(L, 3) <> 777000 Then
Cells(L, 8).Value = Cells(L, 7) - Cells(L, 6)
End If
Next L
End Sub