1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Const NomCompte As String = "BCA"
Const NomBase As String = "CA"
Dim Wb As Excel.Workbook
Set Wb = ThisWorkbook
Dim Ws As Excel.Worksheet
Set Ws = Wb.Worksheets(NomCompte)
Dim List As ListObject
Set List = Ws.ListObjects(NomBase)
List.Sort.SortFields.Clear
List.Sort.SortFields.Add2 _
Key:=Ws.Range(NomBase & "[[#All],[date]]"), SortOn:=xlSortOnValues, Order:= _
xlAscending, DataOption:=xlSortNormal
With List.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With |