Sto cercando di far uscire tramite una txtbox contenuti della lista excel con un textbox di ricerca da visualizzare nella boxlist.
Esce :errore Run time 381
Impossibile impostare la proprietà List. Indice della Matrice di proprietà non valido
Da come si vede se metto una lettere che cercare tutto quello che comincia con la lettere esce l'errore2
Private Sub TextBoxC1_Change()
Dim sh As Worksheet
Set sh = Sheets("Foglio1")
Dim i As Long
Dim x As Long
Dim p As Long
Me.ListBox2.Clear
For i = 3 To sh.Range("B" & Rows.Count).End(xlUp).Row
For x = 1 To Len(sh.Cells(i, 2))
p = Me.TextBoxC1.TextLength
If LCase(Mid(sh.Cells(i, 2), x, p)) = Me.TextBoxC1 And Me.TextBoxC1 <> "" Then
With Me.ListBox2
.AddItem sh.Cells(i, 2)
''errore visualizzato nel database''
.List(ListBox2.ListCount = 1, 1) = sh.Cells(i, 3)
End With
End If
Next x
Next i
End Sub