Sub TRI_Base()
'
Application.EnableEvents = False
' Tri base de données
With Worksheets("Base")
Fin = .Range("DataBase").Rows.Count + 3
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range("A5:A" & Fin), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange ActiveSheet.Range("DataBase")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
With Worksheets("Capteurs")
Fin = .Range("DataCapteurs").Rows.Count + 3
.Sort.SortFields.Clear
.Sort.SortFields.Add Key:=.Range("A5:A" & Fin), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With .Sort
.SetRange ActiveSheet.Range("DataBase")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
Application.EnableEvents = True
End Sub