Bonjour arvin
regarde tout d'abord l'exemple envoyé. si tu as plusieurs critères, il faut remplacer
Selection.AutoFilter Field:=2, Criteria1:=critère
' taille de la sélection à copier
Range("a65536").Select
Selection.End(xlUp).Select
If ActiveCell.Value <> 1 Then
dernière_ligne = ActiveCell.Row
Range("A2:E" & dernière_ligne).Select
Selection.Copy
Windows(nomfichier).Activate
'mettre à la suite
Range("a65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
par quelque chose comme :
Selection.AutoFilter Field:= <n° colonnea>, Criteria1:=<critère colonnea>
' taille de la sélection à copier
Range("a65536").Select
Selection.End(xlUp).Select
If ActiveCell.Value <> 1 Then
dernière_ligne = ActiveCell.Row
Range("A2:E" & dernière_ligne).Select
Selection.Copy
Windows(nomfichier).Activate
'mettre à la suite
sheets("titulaire").activate
Range("a65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
windows(fenêtrelue).activate
Selection.AutoFilter Field:=<n° colonneb>, Criteria1:=<critère colonneb>
' taille de la sélection à copier
Range("a65536").Select
Selection.End(xlUp).Select
If ActiveCell.Value <> 1 Then
dernière_ligne = ActiveCell.Row
Range("A2:E" & dernière_ligne).Select
Selection.Copy
Windows(nomfichier).Activate
'mettre à la suite
sheets("vacataire").activate
Range("a65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
en ce qui concerne le tri, entre "endwith" et "end sub" il faut ajouter, en adaptant à tes colonnes et à ton type de tri
sheets("titulaire").activate
Columns("A:E").Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("C2") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
sheets("vacataire").activate
Columns("A:E").Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Key2:=Range("C2") _
, Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom
Bons essais
Eric