bonjour, je n'ai pas testé, j'ai simplement lu la code et il manquent 2 points qui correspondent avec le with ... end with, je pense
With WbSo.Sheets("Société " & X) ' cette société .
je n'ai pas mis ce code entre </>, autrement je ne pouvais pas utiliser des couleurs.
If .Range("D2").Value = "" Then Exit Sub ' mois choisi
icol = Application.Match(.Range("D2").Value, WbSo.Sheets("calendrier").Range("B2:L2"), 0) 'trouver mois
If Not IsNumeric(icol) Then MsgBox "faux mois": Exit Sub
semaines = Application.Transpose(WbSo.Sheets("calendrier").Range("A3:A7").Offset(, icol)) 'semaines correspondantes (max5)
For i = 1 To 5
If semaines(i) <> "" Then
r = Application.Match(semaines(i), .Range("T4:BS4"), 0) 'colonne de cette semaine
If IsNumeric(r) Then Col(i) = r
End If
Next
Derlig = .Cells(5, "A").End(xlDown).Row
Edit : non, je me trompe l'activesheet est le sheet pour ce with ... end with, on peut effacer quelque lignes