T
ThierryR
Guest
Bonjours à tous,
Je viens vous soumettre ces quelques lignes de codes ayant besoin de savoir ce qui ne fonctionne pas. J'aimerais trier une zone dont le nombre de lignes est variable et ceci des critères de tri sur 3 colonnes.
Merci beaucoup d'avance.
ThierryR
'Tri de la liste des immobilisations pour la présentation du tableau
Worksheets("Liste Immobilisations").Activate
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields.Clear
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields. _
Add Key:=Range("B2:B" & I), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields. _
Add Key:=Range("E2:E" & I), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields. _
Add Key:=Range("H2:H" & I), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With Worksheets("Liste Immobilisations").AutoFilter.Sort
.SetRange Range("A1:Y" & I)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Je viens vous soumettre ces quelques lignes de codes ayant besoin de savoir ce qui ne fonctionne pas. J'aimerais trier une zone dont le nombre de lignes est variable et ceci des critères de tri sur 3 colonnes.
Merci beaucoup d'avance.
ThierryR
'Tri de la liste des immobilisations pour la présentation du tableau
Worksheets("Liste Immobilisations").Activate
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields.Clear
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields. _
Add Key:=Range("B2:B" & I), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields. _
Add Key:=Range("E2:E" & I), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
Worksheets("Liste Immobilisations").AutoFilter.Sort.SortFields. _
Add Key:=Range("H2:H" & I), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With Worksheets("Liste Immobilisations").AutoFilter.Sort
.SetRange Range("A1:Y" & I)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With