Merci Amadeus,
Voici un extrait de mon code:
Option Explicit
Dim tablo, tabloR(), dico As Object
Dim i&, j&, k&, col&, nbMax&, nbcolR&
Sub NllePresentation()
Application.ScreenUpdating = False 'Empeche le rafraichissement de l'écran
tablo = Range("A1").CurrentRegion
Set dico = CreateObject("Scripting.Dictionary")
'On compte les Numéros différents
nbMax = 0
For i = 2 To UBound(tablo, 1)
If dico.exists(tablo(i, 5)) Then
dico(tablo(i, 5)) = dico(tablo(i, 5)) + 1
Else
dico(tablo(i, 5)) = 1
End If
If nbMax < dico(tablo(i, 5)) Then
nbMax = dico(tablo(i, 5))
End If
Next i
k = 0
For i = 2 To UBound(tablo, 1)
If tablo(i, 5) = tablo(i - 1, 5) Then
For col = 16 To 11 + 3 * nbMax Step 3
If tabloR(col, k) = "" Then
Exit For
End If
Next col
tabloR(col, k) = tablo(i, 16)
tabloR(col + 1, k) = tablo(i, 17)
tabloR(col + 2, k) = tablo(i, 18)
Else
ReDim Preserve tabloR(1 To 14 + 3 * nbMax, 1 To k + 1)
For j = 1 To 18
tabloR(j, 1 + k) = tablo(i, j)
Next j
k = k + 1
End If
Next i
With Sheets("1er vols rotations Résultat")
.Range("A1").CurrentRegion.Clear
Range("A1:O1").Copy .Range("A1")
Range("P1:AA1").Copy .Range(.Cells(1, 16), .Cells(1, 12 + 1 * nbMax))
.Range("A2").Resize(UBound(tabloR, 2), UBound(tabloR, 1)) = _
Application.Transpose(tabloR)
.Activate
End With
Erase tabloR
Range("A1").Select
End Sub
Et le fichier joint.
Merci pour ton aide
Titty