Private Sub Worksheet_Activate()
Dim tablo, ncol%, d As Object, i&, x$, dat As Date, y$, n&, j%
With [table_1]
.Sort .Cells(1), xlAscending, Header:=xlYes 'tri de sécurité
tablo = .Value
End With
ncol = UBound(tablo, 2)
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(tablo)
x = tablo(i, 1)
If x <> "" Then
dat = CDate(Mid(x, 4, 3) & Left(x, 3) & Mid(x, 7)) 'jour/mois dans le bon ordre jj/mm
x = Left(x, 13) & tablo(i, 5) 'les minutes sont exclues
If Weekday(dat, 2) < 6 And Not d.exists(x) Then 'du lundi au vendredi
d(x) = ""
n = n + 1
For j = 1 To ncol
tablo(n, j) = tablo(i, j)
Next j
End If
End If
Next i
'---restitution---
If FilterMode Then ShowAllData 'si la feuille est filtrée
With [A2] '1ère cellule de destination
If n Then .Resize(n, ncol) = tablo
.Offset(n).Resize(Rows.Count - n - .Row + 1, ncol).ClearContents 'RAZ en dessous
.Resize(, ncol).EntireColumn.AutoFit 'ajustement largeurs
End With
'---tableaux de droite---
With Feuil1 'CodeName
Intersect(.UsedRange, .Columns(ncol + 1).Resize(, .Columns.Count - ncol)).EntireColumn.Copy Cells(1, ncol + 1)
End With
With UsedRange: End With 'actualise les barres de défilement
End Sub