Sub Macro1()
ActiveWorkbook.Worksheets("CHERCHER").ListObjects("t_BDD").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("CHERCHER").ListObjects("t_BDD").Sort.SortFields. _
Add2 Key:=Range("t_BDD[Désignation Produits]"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("CHERCHER").ListObjects("t_BDD").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Sub TRI_BIS()
Dim lOBJ As ListObject
Set lOBJ = ActiveWorkbook.Worksheets("CHERCHER").ListObjects("t_BDD")
lOBJ.Range.Sort _
Key1:=lOBJ.ListColumns(1), _
Order1:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom
End Sub
Sub TRI_TER()
Dim lOBJ As ListObject
Set lOBJ = ActiveWorkbook.Worksheets("CHERCHER").ListObjects("t_BDD")
lOBJ.Range.Sort Key1:=lOBJ.ListColumns(1), Order1:=xlAscending, Header:=xlYes
End Sub
Private Sub CommandButton1_Click()
With ListObjects(1).Range 'tableau structuré
.Sort .Cells(1), xlAscending, Header:=xlYes
End With
End Sub