Bonjour,
Essaie ceci :
Private Sub CommandButton1_Click()
Dim i%, k%, n%, nv%, nvk%, nvn%, Tval()
With Worksheets("Feuil1")
With .Cells.SpecialCells(xlCellTypeLastCell)
k = .Column: n = .Row
End With
For i = 1 To n
nv = WorksheetFunction.CountA(.Rows(i))
If nv > 0 Then nvn = nvn + 1
If nv > nvk Then nvk = nv
Next i
ReDim Tval(1 To nvn, 1 To nvk)
nvn = 0: nvk = 0
For i = 1 To n
If WorksheetFunction.CountA(.Rows(i)) > 0 Then
nvn = nvn + 1
For nv = 1 To k
If .Cells(i, nv) <> "" Then
nvk = nvk + 1: Tval(nvn, nvk) = .Cells(i, nv)
End If
Next nv
nvk = 0
End If
Next i
End With
With Worksheets("Feuil2")
With .UsedRange
.ClearContents
.Borders.LineStyle = xlNone
End With
With .Range("A1").Resize(UBound(Tval, 1), UBound(Tval, 2))
.Value = Tval
.HorizontalAlignment = xlCenter
With .Borders
.LineStyle = xlContinuous
.Weight = xlThin
End With
End With
.Activate
End With
End Sub
Cordialement.