Bonjour,
Avec une fonction personnalisée en VBA:
Dans la cellule AG3; mettre la formule suivante: =Nb_Periodes(B3:AE3)
Le code de la fonction:
Function Nb_Periodes(Plage As Range) As Long
Dim Cpt As Long, Cpt_Inter As Long
Dim Cell As Range
Cpt = 0
Cpt_Inter = 0
For Each Cell In Plage
If Cell = "m" And Cpt_Inter = 0 Then
Cpt_Inter = 1
Cpt = Cpt + 1
ElseIf Cell.Interior.ColorIndex = 6 Then
GoTo Suivant
ElseIf Cell <> "m" Then
Cpt_Inter = 0
End If
Suivant:
Next
Nb_Periodes = Cpt
End Function
Cdlt