Option Explicit
Sub JoursParticuliers()
Dim tbl(), J&, A&, D As Date, lig&, mois, Q&, Q2&
Dim Debut As Date, Fin As Date, i&, leMois&, n&
' lun->1; mar->2; mer->3; jeu->4; ven->5; sam->6; dim->7' séparés par un espace
Const Jours = " 2 3 "
Const Ici = "b4" ' première cellule pour l'affichage du résultat
Q2 = 365: mois = 1
With Sheets("Feuil1")
Debut = Int(.[b1]): Fin = Int(.[b2])
For J = 0 To 365
D = CDate(Debut) + J
If Jours Like "* " & Weekday(D, 2) & " *" Then
If Month(D) <> mois Then A = A + 1: ReDim Preserve tbl(1 To A): mois = Month(D)
A = A + 1: ReDim Preserve tbl(1 To A): tbl(A) = CLng(D)
Q = Abs(DateDiff("d", Date, D, vbMonday, vbUseSystem))
If Q < Q2 Then Q2 = Q: lig = A
End If
Next
With .Range(Ici).Resize(UBound(tbl))
.ClearContents
.Interior.Color = xlNone
.Value = Application.Transpose(tbl)
.NumberFormat = "dddd dd mmmm yyyy"
.Cells(lig).Interior.Color = RGB(255, 180, 0)
End With
End With
End Sub