Bonjour
Voila j'ai adapté du code à mon application, qui fonctionne en partie mais j'ai des soucis avec la fonction auto tabulation qui ne fonctionne pas.Il est vrais que je n'ai pas tout compris ce code
La fonction est de rechercher dans toutes les colonnes la lettre ou le chiffre tapé dans le label Tbx1,puis d'affiner au fur et à mesure des valeurs entrées dans TBX1
merci
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 Private Sub Tbx1_Change() On Error Resume Next Application.ScreenUpdating = False t = Range("A3:I" & Range("A65536").End(xlUp).Row) Lbx1.Clear x = 1 For i = 1 To UBound(t) For j = 1 To 9 If Left(t(i, j), Len(Tbx1)) = Left(Tbx1, Len(Tbx1)) Then ReDim Preserve ta(1 To 9, 1 To x) For k = 1 To 9 ta(k, x) = t(i, k) Next k: x = x + 1: End If: Next j: Next i Lbx1.List = Application.Transpose(ta) If x - 1 = 1 Then For e = 1 To 9 Controls("Textbox" & e) = Lbx1.List(Lbx1.ListIndex + e) Next e: Lbx1.Clear: End If Erase t, ta If Tbx1 = "" Then Lbx1.Clear: Label2.Caption = "" For e = 1 To 9: Controls("Textbox" & e) = "": Next e: Lbx1.Clear: End If Beep End Sub
Partager