Sub tata()
Dim orig As Range, dest As Range
Dim i&, j&, k&, l&, p$, s, r(), oCel As Range
Const u = 65000 ' Peut être modifié. Ne pas dépasser 65536.
Set orig = Sheets("Feuil1").Columns(1).Resize(Rows.Count - 4).Offset(4, 0) 'Plage des données.
Set dest = Sheets("Feuil2").[A3] 'Première cellule de destination.
If IsEmpty(orig.Cells(orig.Cells.Count)) Then
Set orig = Sheets("Feuil1").Range(Cells(orig.Row, 1), Cells(Columns(orig.Column).Cells(Rows.Count, 1).End(xlUp).Row, 1))
End If
For Each oCel In orig.Cells
If Not IsEmpty(oCel) Then
j = j + 1
k = 1
ReDim Preserve r(1 To 3, 1 To j)
s = Split(oCel.Value, "/")
For i = 0 To UBound(s)
If IsNumeric(s(i)) Then
k = k + 1
r(k, j) = s(i)
If k = 3 Then Exit For
Else
If k = 1 Then
If p <> "" Then p = p & "/"
p = p & s(i)
End If
End If
Next i
If Right$(p, 1) <> "/" Then p = p & "/"
r(1, j) = p
p = ""
If j = u Then
dest.Resize(u, 3).Offset(l, 0).Value = WorksheetFunction.Transpose(r): Erase r
l = l + u
j = 0
End If
End If
Next
If j Then dest.Resize(j, 3).Offset(l, 0).Value = WorksheetFunction.Transpose(r): Erase r
End Sub
Sub tutu()
Dim orig As Range, dest As Range
Dim i&, j&, k&, p$, s, oCel As Range
Set orig = Sheets("Feuil1").Columns(1).Resize(Rows.Count - 4).Offset(4, 0) 'Plage des données.
Set dest = Sheets("Feuil2").[A3] 'Première cellule de destination.
If IsEmpty(orig.Cells(orig.Cells.Count)) Then
Set orig = Sheets("Feuil1").Range(Cells(orig.Row, 1), Cells(Columns(orig.Column).Cells(Rows.Count, 1).End(xlUp).Row, 1))
End If
ReDim r(1 To orig.Cells.Count, 1 To 3)
t = Timer
For Each oCel In orig.Cells
If Not IsEmpty(oCel) Then
j = j + 1
k = 1
s = Split(oCel.Value, "/")
For i = 0 To UBound(s)
If IsNumeric(s(i)) Then
k = k + 1
r(j, k) = s(i)
If k = 3 Then Exit For
Else
If k = 1 Then
If p <> "" Then p = p & "/"
p = p & s(i)
End If
End If
Next i
If Right$(p, 1) <> "/" Then p = p & "/"
r(j, 1) = p
p = ""
End If
Next
dest.Resize(j, 3).Value = r: Erase r
End Sub