Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If UCase(Left(Sh.Name, 5)) <> "SITE_" Then Exit Sub
Dim critere$, derlig&
critere = Mid(Sh.Name, 6)
Application.ScreenUpdating = False
If Sh.FilterMode Then Sh.ShowAllData 'si la feuille est filtrée
Sh.Rows("6:" & Sh.Rows.Count).Delete
With Sheets("Sheet1")
If .FilterMode Then .ShowAllData 'si la feuille est filtrée
derlig = .Cells(.Rows.Count, 3).End(xlUp).Row
.[K7] = "=C7=""" & critere & """"
.Range("A6:I" & derlig).AdvancedFilter xlFilterCopy, .[K6:K7], Sh.[A6:I6] 'filtre avancé
.[K7] = ""
End With
derlig = Sh.Cells(Sh.Rows.Count, 3).End(xlUp).Row
Sh.Range("C6:C" & derlig).Delete xlToLeft
Range("A6:H" & derlig).Borders(xlEdgeBottom).Weight = xlMedium 'bordure du bas
With Sh.UsedRange: End With 'actualise les barres de défilement
End Sub