Aide listbox
Résolu/Fermé
kadiski
Messages postés
50
Date d'inscription
vendredi 4 mars 2016
Statut
Membre
Dernière intervention
26 février 2022
-
24 mai 2016 à 11:55
kadiski Messages postés 50 Date d'inscription vendredi 4 mars 2016 Statut Membre Dernière intervention 26 février 2022 - 24 mai 2016 à 14:02
kadiski Messages postés 50 Date d'inscription vendredi 4 mars 2016 Statut Membre Dernière intervention 26 février 2022 - 24 mai 2016 à 14:02
1 réponse
f894009
Messages postés
16904
Date d'inscription
dimanche 25 novembre 2007
Statut
Membre
Dernière intervention
18 mars 2023
1 678
24 mai 2016 à 13:43
24 mai 2016 à 13:43
Bonjour,
Si j'ai bien compris votre demande:
Si j'ai bien compris votre demande:
Private Sub CommandButton1_Click()
If ListBox1.ListCount > 0 Then
With Worksheets("mise en page")
derlig = .Range("D" & Rows.Count).End(xlUp).Row
If derlig < 5 Then derlig = 5
.Range("A13:C20" & derlig).ClearContents
.Range("A13").Resize(ListBox1.ListCount) = ListBox1.List
.Activate
End With
Else
MsgBox " Pas d'info dans la listbox!!!!!!!"
End If
End Sub
Private Sub TextBox1_Change()
Application.ScreenUpdating = False
Range("A5:F40").Interior.ColorIndex = 2
ListBox1.Clear
ListBox1.IntegralHeight = False
ListBox1.ColumnCount = 1
If TextBox1 <> "" Then
For ligne = 5 To 50
If Cells(ligne, 2) Like TextBox1 & "*" Then
Cells(ligne, 1).Resize(, 4).Interior.ColorIndex = 8
ListBox1.AddItem Cells(ligne, 2) & " - " & Cells(ligne, 3) & " - " & Cells(ligne, 4)
' la list box prends en compte les lignes 5 à 50 du tableau et les colonnes ABC et D'
End If
Next
End If
If ListBox1.ListCount < 1 Then Msgnbox " Pas d'info trouvee !!!!!!!"
End Sub
24 mai 2016 à 14:02
en te remerciant et bonne continuation