Sub heritias()
With Sheets("Synthése")
.Columns("D:AL").Delete Shift:=xlToLeft
.Rows("2:3000").Delete Shift:=xlUp
End With
lig = Sheets("Origine").Cells(65000, 1).End(xlUp).Row
For i = 2 To lig
With Sheets("origine")
a = .Cells(i, 1)
a2 = .Cells(i - 1, 1)
b = .Cells(i, 2)
c = .Cells(i, 3)
d = "Référence article"
e = "Libelle article"
End With
If a <> a2 Then
With Sheets("Synthése")
lig1 = .Cells(65000, 1).End(xlUp).Row + 1
.Cells(lig1, 1) = a
.Cells(lig1, 2) = b
.Cells(lig1, 3) = c
End With
Else
With Sheets("Synthése")
lig2 = .Cells(65000, 1).End(xlUp).Row '+ 1
col1 = .Cells(lig2, 320).End(xlToLeft).Column + 1
.Cells(lig2, col1) = b
.Cells(lig2, col1 + 1) = c
.Cells(1, col1) = d
.Cells(1, col1 + 1) = e
End With
End If
Next
End Sub