Static Sub TriColonne()
Dim sens As Boolean
Dim wrksht As Worksheet
Dim oListObj As ListObject
Application.ScreenUpdating = False
Call ProtectSoloOFF 'Unprotect
Feuille = ActiveSheet.Name
Set wrksht = ActiveWorkbook.Worksheets(Feuille)
Set oListObj = wrksht.ListObjects(1)
Tableau = oListObj.Name
Columnadress = ActiveCell.Column
Var = Cells(10, Columnadress) 'Mon tableau commence à la ligne 10
If Columnadress < 14 Then 'Colonne fin de tableau
Select Case bSens
Case True
ActiveWorkbook.Worksheets(Feuille).ListObjects(Tableau).Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets(Feuille).ListObjects(Tableau).Sort.SortFields. _
Add Key:=Range(Tableau & "[[#All],[" & Var & "]]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets(Feuille).ListObjects(Tableau).Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Case False
ActiveWorkbook.Worksheets(Feuille).ListObjects(Tableau).Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets(Feuille).ListObjects(Tableau).Sort.SortFields. _
Add Key:=Range(Tableau & "[[#All],[" & Var & "]]"), SortOn:=xlSortOnValues, _
Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets(Feuille).ListObjects(Tableau).Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Select
bSens = Not bSens
End If
Call ProtectSoloON 'Unprotect
Application.ScreenUpdating = True
End Sub