re,
j'ai ajouté une gestion d'erreur pour les items non présent sur les 2 feuilles,
Private Sub test()
Set wk1 = Sheets("MOIS_RETRAITÉ")
Set wk2 = Sheets("DELAIS_LIV_CLIENTS")
Application.ScreenUpdating = False
If colonne = 0 Then Exit Sub
For i = 2 To wk2.Cells(Rows.Count, 2).End(xlUp).Row
If wk2.Cells(i, 5) <> 0 Then
code = wk2.Cells(i, 2) & wk2.Cells(i, 3)
t = "=MATCH(""" & code & """,MOIS_RETRAITÉ!A:A&MOIS_RETRAITÉ!D:D,0)"
rw = Evaluate(t)
If Not IsError(rw) Then
col = wk1.Cells(rw, "AT").End(xlToLeft).Column
If col = 45 Then Exit Sub
wk1.Range(Cells(rw, colonne).Address, Cells(rw, col).Address).Cut wk1.Cells(rw, 10 + wk2.Cells(i, 5).Value + colonne - 10)
End If
End If
Next i
Application.ScreenUpdating = True
End Sub
note/ ce code est très gourmand tu risque de manquer de mémoire s'il y a trop de lignes