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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| Option Explicit
Sub Test_Points()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''' INITIALISATION DES VARIABLES '''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim pasligne As Integer
Dim numNom As Integer
Dim compteur As Integer
compteur = 3
Dim ComptPoints() As Integer
ReDim ComptPoints(compteur - 1)
For i = 0 To compteur - 1
ComptPoints(i) = 0
Next i
Dim Noms(2) As String
Noms(0) = "fgfrgfgfgr"
Noms(1) = "dddszdsd"
Noms(2) = "Félix"
'Maintenant on compare les résultats réels aux pronostics de chacun (feuille "Poules")
'On comptabilise les points dans une liste (points/joueurs)
'On entre ensuite le total des points pour le joueur correspondant dans la feuille "Prono-Points"
'For pasligne = 9 To 64 Step 11 'Boucle pour regarder tous les groupes
pasligne = 9
For i = pasligne To pasligne + 5 'Boucle pour regarder tous les matchs d'un groupe
For j = 20 To (20 + 6 * (compteur - 1)) Step 6 'Boucle pour regarder tous les noms, valeur de fin arbitraire
'On ne regarde que les matchs dont le résultat a été correctement pronostiqué.
'On affine aussi en regardant les matchs où le score a été correctement pronostiqué.
If (Cells(i, 3).Value - Cells(i, 4).Value > 0 And Cells(i, j).Value - Cells(i, j + 1).Value > 0) Or (Cells(i, 3).Value - Cells(i, 4).Value < 0 And Cells(i, j).Value - Cells(i, j + 1).Value < 0) Or (Cells(i, 3).Value - Cells(i, 4).Value = 0 And Cells(i, j).Value - Cells(i, j + 1).Value = 0) Then
'On regarde les scores devinés parfaitement
If Cells(i, 3).Value = Cells(i, j).Value And Cells(i, 4).Value = Cells(i, j + 1).Value Then
For k = 0 To compteur - 1
If Cells(3, j).Value = Noms(k) Then
ComptPoints(k) = ComptPoints(k) + 3
End If
Next k
End If
'Le score est faux mais le résultat est bon
Else
For k = 0 To compteur - 1
If Cells(3, j).Value = Noms(k) Then
ComptPoints(k) = ComptPoints(k) + 1
End If
Next k
End If
Next j
Next i
'Next pasligne
For i = 0 To compteur - 1
MsgBox ("Le nombre de points de " & Noms(i) & " est " & ComptPoints(i) & " points")
Next i
End Sub |
Partager