1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| Public Sub Compter()
Dim ligne As Long
Dim colonne As Long
Dim jourOrd As Long
Dim jourSup As Long
For ligne = 4 To 62
For colonne = 4 To 33
If Cells(ligne, colonne) = "X" Then
jourOrd = jourOrd + 1
ElseIf Cells(ligne, colonne) <> "X" Then
Select Case Cells(ligne, colonne + 1)
Case "RT", "FT"
jourOrd = jourOrd + 1
jourSup = jourSup - 1
Case Else
If Cells(ligne, colonne) = "RT" Then
jourSup = jourSup + 1
ElseIf Cells(ligne, colonne) = "FT" Then
jourSup = jourSup + 1
ElseIf Cells(ligne, colonne) = "PL" Then
jourSup = jourSup + 1
ElseIf Cells(ligne, colonne) = "AT" Then
jourSup = jourSup + 1
ElseIf Cells(ligne, colonne) = "F" Then
jourSup = jourSup + 1
ElseIf Cells(ligne, colonne) = "JS" Then
jourSup = jourSup + 1
ElseIf Cells(ligne, colonne) = "PL" Then
jourOrd = jourOrd + 1
ElseIf Cells(ligne, colonne) = "JB" Then
jourOrd = jourOrd + 1
ElseIf Cells(ligne, colonne) = "AT" Then
jourOrd = jourOrd + 1
ElseIf Cells(ligne, colonne) = "DM" Then
jourOrd = jourOrd + 1
ElseIf Cells(ligne, colonne) = "F" Then
jourOrd = jourOrd + 1
End If
End Select
End If
Cells(ligne, 35) = jourOrd
Cells(ligne, 36) = jourSup
Next colonne
jourOrd = 0
jourSup = 0
Next ligne
End Sub |
Partager