Si on a un retour a la ligne cela ne fonctionne pas
dsfsdf sdf
Colis numero 8r0165555
ce n'est pas à cause du retour à la ligne mais parce qu'il n'y a pas d'espace entre sdt et Colis
il faufrait remplace les Chr(10)
par Chr(32)
Sub NoColis()
Dim v, i As Integer, rw As Long
rw = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:A" & rw).Replace What:=Chr(10), Replacement:=Chr(10), SearchOrder:=xlByColumns, MatchCase:=False
For i = 2 To Cells(Rows.Count, "A").End(xlUp).Row
Rng = Cells(i, "A")
v = Split(Rng, Chr(32))
For j = LBound(v) To UBound(v)
On Error Resume Next
t = v(j) & " " & v(j + 1)
If t = "Colis numero" Then Cells(i, "C") = v(j + 2)
Next j
Next i
End Sub
note/
si tu veux garder le retour à la ligne,
remplace cette ligne
Range("A1:A" & rw).Replace What:=Chr(10), Replacement:=Chr(32), SearchOrder:=xlByColumns, MatchCase:=False
par
Range("A1:A" & rw).Replace What:=Chr(10), Replacement:=Chr(10) & Chr(32), SearchOrder:=xlByColumns, MatchCase:=False