Sub Insertion()
Dim tablo, ncol%, resu(), i&, n&, j%
With Feuil1 'CodeName de la feuille
tablo = IIf(.UsedRange.Count = 1, .UsedRange.Resize(, 2), .UsedRange)
ncol = UBound(tablo, 2)
ReDim resu(1 To 2 * UBound(tablo), 1 To ncol)
For i = 2 To UBound(tablo)
If tablo(i, 1) <> "" Then
n = n + 1
For j = 1 To ncol
resu(n, j) = tablo(i, j)
Next j
End If
n = n + 1
Next i
'---restitution---
.[A2].Resize(n, ncol) = resu
End With
End Sub
Sub RAZ()
Application.ScreenUpdating = False
On Error Resume Next 'si aucune SpecialCell
With Feuil1.UsedRange
.Cells(1).EntireColumn.Insert
.Columns(0) = "=REPT(1,RC[1]<>"""")"
.Columns(0) = .Columns(0).Value
Union(.Columns(0), .Cells).Sort .Columns(0), Header:=xlYes 'tri pour accélérer
Intersect(.Columns(0).SpecialCells(xlCellTypeBlanks).EntireRow, .Cells).Delete xlUp
.Columns(0).EntireColumn.Delete
End With
End Sub