bonjour

pq mon code ne fonctionne pas, j'ai adapté le code de l'enregistreur de code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Sub TriCodeAbs()
 
Dim plage As range
Dim f As Sheets
 
Set f = "Divers"
plage = sh_divers.range("A2:C23")
 
plage.Select
plage.Sort.SortFields.Clear
plage.Sort.SortFields.Add Key:=range("A2:A23"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
    xlSortNormal
With f.Sort
    .SetRange range("A1:C23")
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
End With
 
Set f = Nothing
 
End Sub