Listbox2 = .cells(lig1,"F")?
ordinateur!
-
michel_m Messages postés 18903 Date d'inscription Statut Contributeur Dernière intervention -
michel_m Messages postés 18903 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
merci de m aider a résoudre le problème
mot = nom
une fois trouve le nom
ex D3
lis
listbox1 = .cells(lig1,"E")?
listbox2 = .cells(lig1,"F")?
UserForm.ListBox1.Value = .Cells(Lig1, "E")
Private Sub CommandButton1_Click()
Dim Mot, Nbre As Byte, cptr As Byte, Lig1 As Long, lig2 As Integer
Application.ScreenUpdating = False
With Sheets("feuil1")
On Error GoTo saisie
Mot = InputBox("Mot à rechercher ?")
Nbre = Application.CountIf(.Range("D2:D500"), Mot)
If Nbre = 0 Then GoTo vide
Lig1 = Cells.Rows.Count
lig2 = 1
For cptr = 1 To Nbre
Lig1 = .Columns("D").Find(Mot, .Cells(Lig1, "D"), xlValues).Row
UserForm.ListBox1.Value = .Cells(Lig1, "E")
Next
End With
UserForm1.Hide
Exit Sub
merci de m aider a résoudre le problème
mot = nom
une fois trouve le nom
ex D3
lis
listbox1 = .cells(lig1,"E")?
listbox2 = .cells(lig1,"F")?
UserForm.ListBox1.Value = .Cells(Lig1, "E")
Private Sub CommandButton1_Click()
Dim Mot, Nbre As Byte, cptr As Byte, Lig1 As Long, lig2 As Integer
Application.ScreenUpdating = False
With Sheets("feuil1")
On Error GoTo saisie
Mot = InputBox("Mot à rechercher ?")
Nbre = Application.CountIf(.Range("D2:D500"), Mot)
If Nbre = 0 Then GoTo vide
Lig1 = Cells.Rows.Count
lig2 = 1
For cptr = 1 To Nbre
Lig1 = .Columns("D").Find(Mot, .Cells(Lig1, "D"), xlValues).Row
UserForm.ListBox1.Value = .Cells(Lig1, "E")
Next
End With
UserForm1.Hide
Exit Sub
2 réponses
-
Bonjour,
merci de m aider a résoudre le problème
Quel est le problème ? -
bonjour
For cptr = 1 To Nbre
Michel
Lig1 = .Columns("D").Find(Mot, .Cells(Lig1, "D"), xlValues).Row
Me.ListBox1.AddItem = .Cells(Lig1, "E")
Me.ListBox2.AddItem = .Cells(Lig1, "F")
Next--
Mot non défini
dim Mot as ...- a quoi sert lig2 (non défini aussi)