Private Sub CommandButton1_Click() 'rechercher
Dim c As Range, firstAddress As String
With sh_Saison.Range("C5:C384")
Set c = .Find(Me.ComboBox1, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If sh_Saison.Cells(c.Row, 6).Value = Me.ComboBox2 Then Exit Do
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
If c Is Nothing Then Exit Sub
Me.Label2.Caption = "Journéée: " & sh_Saison.Cells(c.Row, 2)
Me.Label3.Caption = Me.ComboBox1
Me.Label4.Caption = sh_Saison.Cells(c.Row, 4)
Me.Label5.Caption = Format(sh_Saison.Cells(c.Row, 7), "dddd dd mmmm yyyy")
Me.Label6.Caption = Me.ComboBox2
Me.Label7.Caption = sh_Saison.Cells(c.Row, 5)
Set c = .Find(Me.ComboBox2, LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
If sh_Saison.Cells(c.Row, 6).Value = Me.ComboBox1 Then Exit Do
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
If c Is Nothing Then Exit Sub
Me.Label8.Caption = "Journéée: " & sh_Saison.Cells(c.Row, 2)
Me.Label9.Caption = Me.ComboBox1
Me.Label10.Caption = sh_Saison.Cells(c.Row, 4)
Me.Label11.Caption = Format(sh_Saison.Cells(c.Row, 7), "dddd dd mmmm yyyy")
Me.Label12.Caption = Me.ComboBox2
Me.Label13.Caption = sh_Saison.Cells(c.Row, 5)
End With
End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
Me.ComboBox1.List = [TS_Equipes].Value
Me.ComboBox2.List = [TS_Equipes].Value
End Sub