1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Public Dcel As Range, Plage As Range, Cel As Range, i As Long
Sub demarrage()
With ActiveWorkbook.Worksheets("Feuil2").ListObjects("Tableau1").Sort
.SortFields. _
Clear
.SortFields. _
Add Key:=Range("A2"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
With Sheets("Feuil1")
For i = 1 To 10 Step 3
Set Dcel = .Cells(.Rows.Count, i).End(xlUp)
Set Plage = .Range(.Cells(1, i), Dcel(1, 2))
Plage.Sort Key1:=.Cells(1, i), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Next
End With
Doublon
End Sub |
Partager