Microsoft 365 Problème d'erreur 13

Dome

XLDnaute Nouveau
bonjour je suistotalement novice et sur un tableau VBA j'ai une erreur 13
sur :
Private Sub TextBoxRech_Change()
If Me.TextBoxRech <> "" Then
mots = Split(Trim(Me.TextBoxRech), " ")
Tbl = choix
For i = LBound(mots) To UBound(mots)
Tbl = Filter(Tbl, mots(i), True, vbTextCompare)
merci de m'aider
 

Dome

XLDnaute Nouveau
Bonjour autre problème,
Row = 10 mais j'ai 18 colonnes, et donc erreur 380
merci de me donner une solution


Option Explicit
Dim i As Long
Dim x As Long
Dim p As Long
Dim a As Integer
Dim NL As Integer
Dim NbL As Integer

Private Sub TextBoxRech_Change()
Me.TextBoxRech = Format(StrConv(Me.TextBoxRech, vbLowerCase))
Dim sh As Worksheet
Set sh = Sheets("BD")
Me.ListBox1.Clear
Me.ListBox1.AddItem "Immat"
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = "Plaque"
Me.ListBox1.List(ListBox1.ListCount - 1, 2) = "Civilité"
Me.ListBox1.List(ListBox1.ListCount - 1, 3) = "Nom"
Me.ListBox1.List(ListBox1.ListCount - 1, 4) = "Prénom"
Me.ListBox1.List(ListBox1.ListCount - 1, 5) = "Téléphone"

For i = 2 To sh.Range("A" & Rows.Count).End(xlUp).Row
For x = 1 To Len(sh.Cells(i, 2))
p = Me.TextBoxRech.TextLength
If LCase(Mid(sh.Cells(i, 1), x, p)) = Me.TextBoxRech And Me.TextBoxRech <> "" Then
With Me.ListBox1
.AddItem sh.Cells(i, 1)
.List(ListBox1.ListCount - 1, 1) = sh.Cells(i, 2)
.List(ListBox1.ListCount - 1, 2) = sh.Cells(i, 3)
.List(ListBox1.ListCount - 1, 3) = sh.Cells(i, 4)
.List(ListBox1.ListCount - 1, 4) = sh.Cells(i, 5)
.List(ListBox1.ListCount - 1, 5) = sh.Cells(i, 6)
.List(ListBox1.ListCount - 1, 6) = sh.Cells(i, 7)
.List(ListBox1.ListCount - 1, 7) = sh.Cells(i, 8)
.List(ListBox1.ListCount - 1, 8) = sh.Cells(i, 9)
.List(ListBox1.ListCount - 1, 9) = sh.Cells(i, 10)
 

Discussions similaires

Réponses
3
Affichages
533