Bonjour,

je viens de crée un user forme pour des recherche de donner avec un message pour dire que les texte et n'est pas dans la base, est la j'ai l'erreur N°1004.

Voila mon 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
 
Private Sub TextBox1_AfterUpdate()
 
    On erroe GoTo 1
 
    If WorksheetFunction.CountIf(Sheets("Base").Range("A:A"), Me.TextBox1.Value) = 0 Then
 
        MsgBox "Cet outil n'excite pas. Veuillez ressaisir un nouveau nom.", vbInformation + vbOKOnly, "Outil non trouvé"
 
   End If
 
    With Me
 
    .TextBox2 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 2, 0)
    .TextBox3 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 3, 0)
    .TextBox4 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 4, 0)
    .TextBox5 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 5, 0)
    .TextBox6 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 6, 0)
    .TextBox7 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 7, 0)
    .TextBox8 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 8, 0)
    .TextBox9 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 9, 0)
    .TextBox12 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 10, 0)
    .TextBox10 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 11, 0)
    .TextBox13 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 12, 0)
    .TextBox11 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 13, 0)
    .TextBox14 = Application.WorksheetFunction.VLookup(TextBox1, Sheets("Base").Range("Source"), 14, 0)
    End With
1
End Sub