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
| Sub Resultat_Equip()
Dim i As Integer
Dim j As Integer
Dim l As Integer
Dim MJ As Integer
Dim G As Integer
Dim P As Integer
Dim N As Integer
Dim Pts As Integer
Dim ScoreDom As Integer
Dim ScoreExt As Integer
Dim wEquipe As Worksheet
Dim wResultat As Worksheet
Dim NomEquipe As String
Set wEquipe = ActiveWorkbook.Worksheets("equipes")
Set wResultat = ActiveWorkbook.Worksheets("resultat")
wEquipe.Activate
wEquipe.Range("A2:I1000").Clear
l = 2
For i = 2 To 100
For j = 2 To 4 Step 2
If j = 2 Then
ScoreDom = 5
ScoreExt = 7
Else
ScoreDom = 7
ScoreExt = 5
End If
MJ = 1
SCM = wResultat.Cells(i, ScoreDom).Value
SCA = wResultat.Cells(i, ScoreExt).Value
SCG = SCM
SCP = SCA
Select Case SCM - SCA
Case Is > 0
G = 1
P = 0
N = 0
Pts = 3
PF = 0
Case Is = 0
G = 0
P = 0
N = 1
Pts = 1
PF = 0
Case Is < 0
G = 0
P = 1
N = 0
Pts = 0
End Select
NomEquipe = wResultat.Cells(i, j).Value
wEquipe.Cells(l, 1).Value = NomEquipe
wEquipe.Cells(l, 2).Value = wEquipe.Cells(l, 2).Value + MJ
wEquipe.Cells(l, 3).Value = wEquipe.Cells(l, 3).Value + G
wEquipe.Cells(l, 4).Value = wEquipe.Cells(l, 4).Value + P
wEquipe.Cells(l, 5).Value = wEquipe.Cells(l, 5).Value + N
wEquipe.Cells(l, 6).Value = wEquipe.Cells(l, 6).Value + Pts
l = l + 1
Next j
Next i
End Sub |
Partager