Bonjour,
Je voudrais faire un simple tri automatique sur plusieurs feuilles (identique dans la structure) lorsque j'ajoute un nom dans la colonne B. Dans ce forum, je suis parvenu à trouver ce que je cherchais (voir code ci-dessous)
Par contre, le tri ne se fait que sur la 1ère feuille. Que faut-il modifier pour ajouter et trier dans toutes les feuilles du classeur ?
Merci
Code Feuil1
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("B:B")) Is Nothing Then
Call Tri
End If
End Sub
Code Module1
Sub Tri()
Dim LastRow As Long
LastRow = ActiveSheet.Range("B2").End(xlDown).Row
Range("B3:I" & LastRow).Sort Key1:=Range("B3"), Order1:=xlAscending, Key2:=Range("B3"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
End Sub