Bonsoir Delf71, fanfan38, le forum,
L’erreur se produit si on lance la macro depuis la Feuil2....
Option Explicit
Sub traitement()
Dim i As Long, lig As Long, col As Integer
Sheets("Feuil2").Cells.Clear
Application.ScreenUpdating = False
With Sheets("Feuil1")
For i = 1 To .Range("A" & Rows.Count).End(xlUp).Row
If Left(.Range("A" & i).Value, 7) = "PRODUIT" Then
lig = Sheets("Feuil2").Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Feuil2").Range("A" & lig).Value = .Range("A" & i)
Else
col = Sheets("Feuil2").Cells(lig, Columns.Count).End(xlToLeft).Column + 1
Sheets("Feuil2").Cells(lig, col).Value = .Range("A" & i).Value
End If
Next i
End With
End Sub
Cordialement,