Sub DécompteMoment()
Dim Periode, Tablo, Dico, Clé As String, i As Long, j As Long
Set Dico = CreateObject("Scripting.Dictionary")
Periode = Array("journée", "matin", "nuit", "après-midi", "soirée") ' à adapter
opérateur = Planner.ComboBox_SelectPersonnel.Value
With Sheets("Base WPL")
Tablo = .Range("B2:E" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
For i = LBound(Tablo) To UBound(Tablo)
If Tablo(i, 1) = opérateur Then
Clé = opérateur & " " & Tablo(i, 4)
Dico(Clé) = Dico(Clé) + 1
End If
Next
For j = LBound(Periode) To LBound(Periode)
Clé = opérateur & Periode(j)
If Dico.exists(Clé) Then Me("TextBox_Nb_" & Periode(j)) = Dico(Clé)
Next
End Sub