Re : récupéré la première donnée
bonsoir
j'ai un petit probleme avec le code
Private Sub TextBox10_Change() 'zone de texte pour la recherche
Dim Plage As Range, cell As Range
Dim Recherche As String, Adresse As String
Dim Ligne As Integer, N As Integer
Dim C As Range
ListBox2.Clear
N = 0
Recherche = TextBox10.Value
Range("A2").Select
Ligne = Sheets(1).Range("A" & "65536").End(xlUp).Row
Set Plage = Sheets(1).Range("a" & "1:" & "a" & Ligne)
With Plage
Set C = .Find(Recherche)
If Not C Is Nothing Then
Adresse = C.Address
Do
If UCase(Recherche) = UCase(Left(C, Len(Recherche))) Then
ListBox2.AddItem C.Offset(0, 0), N
ListBox2.List(N, 0) = C
ListBox2.List(N, 1) = C.Offset(0, 1)
ListBox2.List(N, 2) = C.Offset(0, 2)
ListBox2.List(N, 3) = C.Offset(0, 3)
ListBox2.List(N, 4) = C.Offset(0, 4)
N = N + 1
End If
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> Adresse
End If
TextBox11 = C
End With
Frame6.Caption = "Mr " & TextBox11.Text & " a " & ListBox2.ListCount & " Déclis Actuellement"
End Sub
tous fonctionne quand je tape une lettre qui exite dans la listbox,par contre quand je tape une lettre qui n'existe pas il me met une erreur sur : "TextBox11 = C"