1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Dim Tablo As Variant, Tempo As Variant, i As Long, j As Long, NbCol As Integer
With Worksheets("Feuil1") '.Activate 'à défaut d'instancier la feuille
NbCol = .Cells(1, Columns.Count).End(xlToLeft).Column
Tablo = Application.WorksheetFunction.Transpose(.Range(Cells(1, 1), Cells(1, NbCol)).Value)
End With
'triAlpha
For i = UBound(Tablo) To 1 Step -1
For j = UBound(Tablo) To 1 Step -1
If Tablo(i, 1) < Tablo(j, 1) Then
Tempo = Tablo(i, 1)
Tablo(i, 1) = Tablo(j, 1)
Tablo(j, 1) = Tempo
End If
Next j
Next i
'Recherche de la colonne "suivante" du tablo dans la feuille de calculs pour...
'... la coller avant la colonne 1
Dim c As Range
With Worksheets("Feuil1").Range(Cells(1, 1), Cells(1, NbCol))
For i = 1 To UBound(Tablo)
Set c = .Find(Tablo(i, 1))
Columns(c.Column).Cut
Columns(1).Insert Shift:=xlToRight
Next
End With |
Partager