BONSOIR
dans ce petit progr quel attribut sert a choisir les colonnes à trier
merci à vous tous
Option Explicit
Sub TrierPlages()
Dim i As Byte, lig As Integer
Dim Plage As Range, Cell As Range
For i = 7 To 23 Step 4
Set Plage = Range(Cells(6, i), Cells(25, i + 2))
Plage.Sort Key1:=Cells(6, i), Order1:=xlDescending
For Each Cell In Range(Cells(6, i), Cells(25, i))
If Application.CountIf(Plage, Cell) = 1 Then
Cell.Offset(0, 2) = Cell.Offset(-1, 2) + 1
Else
If Cell <> Cell.Offset(-1, 0) Then
Cell.Offset(0, 2) = Cell.Offset(-1, 2) + 1
Else
Cell.Offset(0, 2) = Cell.Offset(-1, 2)
End If
End If
Next Cell
Plage.Sort Key1:=Cells(6, i + 1), Order1:=xlAscending
Next i
End Sub