Private Sub CommandButton1_Click()
Dim tablo, nlig&, ncol%, j%, n&, i&, nmax&
tablo = Feuil1.[A3].Resize(21, 18) 'matrice, plus rapide, dimensions modifiables
nlig = UBound(tablo): ncol = UBound(tablo, 2)
ReDim resu(1 To nlig, 1 To ncol)
For j = 1 To ncol Step 3
n = 0
For i = 2 To nlig
If tablo(i, j + 1) <> "" Then
n = n + 1
resu(n, j) = tablo(i, j)
resu(n, j + 1) = tablo(i, j + 1)
resu(n, j + 2) = tablo(i, j + 2)
End If
Next
If n > nmax Then nmax = n
Next
'---restitution et masquage des lignes vides---
With [A3] 'modifiable
.Resize(nlig, ncol) = resu
If nmax Then .Resize(nmax).EntireRow.Hidden = False
If nlig > nmax Then .Offset(nmax).Resize(nlig - nmax).EntireRow.Hidden = True
End With
End Sub