Bonjour,
En réponse à Tiralarc, j'ai modifié le code en intégrant une variable "Dercolonne" dynamique.
Cela ne fonctionne pas. Un idée peut-être du problème, ou faudra-t-il coder en dur après l'insertion de nouvelles colonnes?
Merci par avance de aide.
Cdlt
Option Explicit
Public Sub FiltreAuto()
'Jean-Eric
Dim sH_1 As Worksheet
Dim sH_2 As Worksheet
Dim Plage As Range
Dim Dercolonne As Integer
Application.ScreenUpdating = False
Set sH_1 = Worksheets(1)
Set sH_2 = Worksheets(2)
With sH_1
Set Plage = .Range("A4").CurrentRegion
Dercolonne = Cells(4, Cells.Columns.Count).End(xlToLeft).Column
'MsgBox Dercolonne
Plage.AdvancedFilter Action:= _
xlFilterCopy, CriteriaRange:=sH_1.Range("A1:A2"), _
CopyToRange:=sH_2.Range(Cells(1, 1), Cells(1, Dercolonne)), Unique:=False
Plage.AutoFilter
End With
End Sub