Problème compilateur foot
Bonjour,
J'ai un fichier ou je souhaiterais highlight toutes les lignes correspondant a une équipe choisie par une message box puis qui demande l'ID de l'équipe pour afficher une box avec tous les résultats. Voici ce que j'ai fait mais je bloque pour le moment pouvez vous m'aider ?
Public Sub test()
Dim ID As Long
Dim Line As Long
Dim Counter As Long
Dim NbR As Long
Dim NbV As Long
Dim HomeVictory As Long
Dim HomeDefeat As Long
Dim HomeDraw As Long
Dim AwayVictory As Long
Dim AwayDefeat As Long
Dim AwayDraw As Long
Dim Victory As Long
Dim Draw As Long
Dim Defeat As Long
NbR = Cells(2, 4)
NbV = Cells(2, 5)
ID = InputBox("What is the team ID ?")
While (ID < 1 Or ID > 20)
MsgBox "You need to choose an ID team between 1 and 20"
ID = InputBox("What is the team ID ?")
Wend
For Line = 2 To 381
If (Cells(Line, "B").Value = ID) Then
If NbR > NbV Then
HomeVictory = HomeVictory + 1
Else
If NbR < NbV Then
HomeDefeat = HomeDefeat + 1
Else: HomeDraw = HomeDraw + 1
End If
If (Cells(Line, "G").Value = ID) Then
If NbR < NbV Then
AwayVictory = AwayVictory + 1
Else
If NbR > NbV Then
AwayDefeat = AwayDefeat + 1
Else: AwayDraw = AwayDraw + 1
End If
End If
End If
End If
End If
Next Line
Victory = AwayVictory + HomeVictory
Defeat = AwayDefeat + HomeDefeat
Draw = AwayDraw + HomeDraw
MsgBox ("This team won " & AwayVictory)
MsgBox ("This team loose " & Defeat)
MsgBox ("This team counts " & Draw & " draw games")
End Sub
Bonjour et bienvenue sur le forum
Peut-on savoir cà quoi correspondent les termes : Won, Draw, Lost, et Points ?
Et,, à y être ce que tu entends par "highlight toutes les lignes"
Bye !