Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim F As Worksheet, liste, i As Variant, critere As Range
Set F = Sheets("Feuil1")
liste = Array("RELEVE", "WEB", "MAILING") 'liste des noms des feuilles
i = Application.Match(Sh.Name, liste, 0)
If IsError(i) Then Exit Sub
Set critere = F.[F1:F2]
Application.ScreenUpdating = False
Sh.UsedRange.Delete xlUp 'RAZ
Select Case i
Case 1: critere(2) = "=OR(ISNUMBER(SEARCH(""RDC"",A2)),ISNUMBER(SEARCH(""RELEVE"",A2)),ISNUMBER(SEARCH(""RDC"",D2)),ISNUMBER(SEARCH(""RELEVE"",D2)))"
Case 2: critere(2) = "=OR(ISNUMBER(SEARCH(""RELEVE"",A2)),ISNUMBER(SEARCH(""AFP"",D2)),ISNUMBER(SEARCH(""0000"",D2)))"
Case 3: critere(2) = "=OR(ISNUMBER(SEARCH(""Mailing"",A2)),ISNUMBER(SEARCH(""Mailing"",D2)))"
End Select
F.UsedRange.Resize(, 4).AdvancedFilter xlFilterCopy, critere, Sh.[A1] 'copie le filtre avancé
critere.ClearContents
End Sub