Bonjour à tous, salut Banzai,
autre version, voir feuille "Résultat"
j'ai ajouté 3 lignes test
Sub Rapport()
Dim Lg&, x%, i%
Dim f As Worksheet
Application.ScreenUpdating = False
Set f = Sheets("Ce que je reçois")
Lg = f.Range("e" & Rows.Count).End(xlUp).Row
With Sheets("Résultat")
x = Application.Match("Camions", .Range("d:d"), 0) - 5 'dernière ligne du rapport
.Rows("2:" & x + 1).ClearContents
If x > Lg Then .Rows(3).Resize(x - Lg).Delete
If x < Lg Then .Rows(3).Resize(Lg - x).Insert
For i = 2 To Lg
.Cells(i, "a") = f.Cells(i, "e")
.Cells(i, "b") = f.Cells(i, "h")
.Cells(i, "c") = f.Cells(i, "j")
.Cells(i, "d") = f.Cells(i, "m")
.Cells(i, "e") = f.Cells(i, "p")
.Cells(i, "f") = f.Cells(i, "r")
.Cells(i, "g") = f.Cells(i, "s")
Next i
.Range("a1") = "Rapport d'arrivage du " & Date
End With
End Sub
édit: j'avais oublié des "." dans le With
code et fichier modifiés
Bonne journée
Claude