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
| Private Sub ComboBox1_Change()
Dim nom As Range
Dim chaine As String, trouve As String
chaine = ComboBox1.Value
Set nom = Sheets("nico").Columns(1).Cells.Find(chaine, , xlValues, xlWhole)
trouve = nom.Address
If Not nom Is Nothing Then
nom.Select
Me.Controls("Label1").Caption = ActiveCell.Offset(0, 1)
Set nom = Sheets("nico").Columns(1).FindNext(nom)
End If
If Not nom Is Nothing Then
nom.Select
Me.Controls("Label2").Caption = ActiveCell.Offset(0, 1)
Set nom = Sheets("nico").Columns(1).FindNext(nom)
End If
If Not nom Is Nothing Then
nom.Select
Me.Controls("Label3").Caption = ActiveCell.Offset(0, 1)
Set nom = Sheets("nico").Columns(1).FindNext(nom)
End If
If Label1.Caption = Label2.Caption Then
Label2.Visible = False
End If
If Label2.Caption = Label3.Caption Then
Label3.Visible = False
End If
If Label1.Caption = Label3.Caption Then
Label3.Visible = False
End If
End Sub |
Partager