1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Sub Lister()
Application.ScreenUpdating = False
Dim c As Range, i%, n%, txt
With Worksheets("feuil3")
n = .UsedRange.Rows.Count
For Each c In .Range("A2:A" & n)
If InStr(c.Value, Chr(10)) > 0 Then
txt = Split(c.Value, Chr(10))
For i = 0 To UBound(txt)
lig = c.Row
.Rows(lig + 1).Insert
.Range("A" & lig + 1) = txt(i)
.Range("B" & lig + 1) = .Range("B" & lig)
.Range("C" & lig + 1) = .Range("C" & lig)
.Range("D" & lig + 1) = .Range("D" & lig)
Next i
End If
Next c
For Each c In .Range("A2:A" & n)
If InStr(c.Value, Chr(10)) > 0 Then .Rows(c.Row).Delete Shift:=xlUp
Next c
End With
Set txt = Nothing
Application.ScreenUpdating = True
End Sub |
Partager