1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub Macro_TRIER()
ThisWorkbook.Worksheets("Feuil1").Activate
Sheets("Feuil1").Select
ActiveSheet.Unprotect Password:=""
ActiveSheet.Protect DrawingObjects:=False, Contents:=False, Scenarios:=False _
, AllowSorting:=True, AllowFiltering:=True
ActiveWorkbook.Worksheets("Feuil1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Feuil1").AutoFilter.Sort.SortFields.Add Key:=Range _
("A:A"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Feuil1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Sheets("Feuil1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:= _
False
ActiveSheet.Protect Password:=""
Range("AA1").Select
End Sub |
Partager