Sub InsertLigne()
Dim str_item As String
Dim i As Integer
Dim j As Integer
i = 2
str_item = Cells(2, 1)
While Cells(i, 3) <> ""
If str_item <> Cells(i, 1) Then
str_item = Cells(i, 1)
Range(i & ":" & i).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
i = i + 1
Cells(i - 1, 3) = "Ecart Plan "
j = 4
While Not Cells(1, j) Like "*Total*"
Cells(i - 1, j).Value = Cells(i - 3, j) - Cells(i - 2, j)
j = j + 1
Wend
ElseIf Cells(i, 3) = "Actual Hist / Market Fcst" Then
Range(i + 1 & ":" & i + 1).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
i = i + 1
Cells(i, 3) = "Ecart Quantity"
j = 4
While Not Cells(1, j) Like "*Total*"
Cells(i, j) = Cells(i - 1, j) - Cells(i - 2, j)
j = j + 1
Wend
End If
i = i + 1
Wend
End Sub