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
|
Option Explicit ' Pronostic
' ====================== Description de la feuille Prono
Public Const rowMatchFirst = 3 ' rangée du premier match
Public Const rowMatchLast = 242 ' Dernier match
Public Const rowPlayerPoint = rowMatchLast + 1 ' Rangée des points des joueurs
Public Const colMatchScore = 5 ' Score du match
Public Const colPlayerFirst = 7 ' Colonne G du premier joueur
Public Const colPlayerLast = 28 ' Colonne AB du dernier joueur
Sub CalculProno()
Dim indRowMatch As Integer, indColPlayer As Integer
Application.ScreenUpdating = False
For indColPlayer = colPlayerFirst To colPlayerLast ' Pour chaque joueur
For indRowMatch = rowMatchFirst To rowMatchLast ' Pour chaque match
If (Cells(indRowMatch, colMatchScore).Value <> "") Then
If Cells(indRowMatch, indColPlayer).Value = Cells(indRowMatch, colMatchScore).Value Then
Cells(rowPlayerPoint, indColPlayer).Value = Cells(rowPlayerPoint, indColPlayer).Value + 1
End If
End If
Next
Next
Application.ScreenUpdating = True
End Sub |