Re : Excel2010 Macro tri sur feuille active
Bonjour,
Merci pour ta réponse mais je n'y arrive pas et voilà ce qu'il me donne :
Rows("4:1003").Select
With ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear
With ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key:=Range("JW4:JW1003") _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
With With ActiveWorkbook.ActiveSheet.Sort .SetRange Range("A4:KE1003")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Call TriA
Range("A4").Select
End Sub
Sub TriA()
'
' TriA Macro
'
'
Range("A4:JN1003").Select
Range("JN1003").Activate
With ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear
With ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key:=Range("A4:A1003"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With With ActiveWorkbook.ActiveSheet.Sort .SetRange Range("A4:JN1003")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A4").Select
End Sub
Sub TriOF()
'
' TriOF Macro
'
'
With ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear
With ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key:=Range("JP4:JP1003") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With With ActiveWorkbook.ActiveSheet.Sort
.SetRange Range("JP4:JZ1003")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Merci pour ton aide,
Lionel,