Private Function ordre(Origine As Range, nbLig&, nbCol&, c1, Optional c2, Optional c3, Optional f As Boolean)
Dim dat As Range, p() As Variant
With Origine
Set dat = .Parent.Range(.Cells, .Parent.Cells(nbLig, .Column).End(-4162))
p = dat.Resize(, nbCol).Value
With .Parent.Sort
With .SortFields
.Clear
.Add Key:=dat.Offset(0, c1(0)), SortOn:=0, Order:=c1(1), DataOption:=0
If Not IsMissing(c2) Then .Add Key:=dat.Offset(0, c2(0)), SortOn:=0, Order:=c2(1), DataOption:=0
If Not IsMissing(c3) Then .Add Key:=dat.Offset(0, c3(0)), SortOn:=0, Order:=c3(1), DataOption:=0
End With
.SetRange dat.Resize(, nbCol)
.Header = 2: .MatchCase = 0: .Orientation = 1: .SortMethod = 1
.Apply
End With
ordre = dat.Resize(, nbCol).Value
If f Then dat.Resize(, nbCol).Value = p
End With
End Function