Bonjour,

Mon problème est que je suis incapable de comprendre le find et le find next.

J'ai une petite base de donnée avec des noms et leur adresses, no téléphone etc.
J'aimerais que lorsque j'appuie sur le bouton "recherche" les infos se place dans mes textBox ou comboBox et si le nom est ok je peux faire les modification du profil du client sinon, je passe au suivant.

Le code si dessous me donne le nom que je veux, mais j'aimerais être capable de passer au suivant, car souvent il existe des noms qui sont identiques.

Voici le code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Private Sub CommandButton_cherche_Click()
 
Dim rngTrouve As Range
Dim lig As Integer
lig = Columns(2).Cells.Find(TextBox_Nom).Row
Set rngTrouve = ActiveSheet.Columns(2).Cells.Find(what:=TextBox_Nom)
    If rngTrouve Is Nothing Then
 
    MsgBox "Inexistant"
 
    Else
        Cells.Find(what:=TextBox_Nom).Activate
        TextBox_Nom.Value = Cells(lig, 2)
        TextBox_Prenom.Value = Cells(lig, 3)
        TextBox_conjoint.Value = Cells(lig, 4)
        TextBox_Adresse.Value = Cells(lig, 5)
        TextBox_Ville.Value = Cells(lig, 6)
        TextBox_Province.Value = Cells(lig, 7)
        TextBox_CP.Value = Cells(lig, 8)
        TextBox_Tel1.Value = Cells(lig, 9)
        TextBox_Tel2.Value = Cells(lig, 10)
        TextBox_Adressecourriel.Value = Cells(lig, 11)
        CheckBox_CHEL.Value = Cells(lig, 12)
        CheckBox_CHJAP.Value = Cells(lig, 13)
        CheckBox_CHT.Value = Cells(lig, 14)
        CheckBox_Rdvmed.Value = Cells(lig, 18)
        CheckBox_Myosotis.Value = Cells(lig, 15)
        CheckBox_Finvie.Value = Cells(lig, 17)
        CheckBox_Pastorale.Value = Cells(lig, 16)
        CheckBox_comres.Value = Cells(lig, 19)
 
 
End If
 
Set rngTrouve = Nothing
End Sub
Merci