Ceci est une page optimisée pour les mobiles. Cliquez sur ce texte pour afficher la vraie page.

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
 

jmfmarques

XLDnaute Accro
Bonjour
Tbl = choix ' ---->> et on ne sait pas ni ce qu'est choix, ni son type.
et on ne sait pas non plus comment a été déclarée tbl

et donc
Tbl = Filter(Tbl, mots(i), True, vbTextCompare)

ne peut qu'être en erreur !
 

jmfmarques

XLDnaute Accro
je me permet de vous envoyer mon fichier,
désolé, mais ce sera alors sans moi (je n'ouvre aucun classeur tiers)
Avec moi, c'est le code, accompagnant les tenants et aboutissants et ne concernant que la difficulté rencontrée, parfaitement isolée.
Je te laisse donc entre d'autres mains.
 

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

Les cookies sont requis pour utiliser ce site. Vous devez les accepter pour continuer à utiliser le site. En savoir plus…