Dim c As Range, datas, lig As Long, i As Long
With Sheets("Pour de bon")
Set c = .Rows(1).Find("SKU Offre", , xlValues, xlWhole)
If c Is Nothing Then
MsgBox "Champ SKU Offre non trouvé": Exit Sub
Else
datas = c.Offset(1).Resize(.Cells(Rows.Count, 1).End(xlUp).Row)
For lig = 1 To UBound(datas) - 1
i = 0
Do
i = i + 1
Loop Until Mid(datas(lig, 1), i, 1) Like "#" Or i = Len(datas(lig, 1))
If i < Len(datas(lig, 1)) Then datas(lig, 1) = Left(datas(lig, 1), i - 1)
Next lig
End If
c.Offset(1).Resize(UBound(datas)) = datas
Set c = .Rows(1).Find("Details", , xlValues, xlWhole)
If c Is Nothing Then
MsgBox "Champ Details non trouvé": Exit Sub
Else
datas = c.Offset(1).Resize(.Cells(Rows.Count, 1).End(xlUp).Row)
For lig = 1 To UBound(datas) - 1
i = InStr(datas(lig, 1), " (")
If i > 0 Then datas(lig, 1) = Left(datas(lig, 1), i - 1)
Next lig
End If
c.Offset(1).Resize(UBound(datas)) = datas