Problème avec une listbox
Bonjour,
j'ai besoin d'une petite aide pour ma listbox :
Pour résumé j'ai une liste déroulante je choisis un critère,
ensuite ma listbox affiche plusieurs autres critères selon un onglet ,
j'ai écrit ce bout de code mais quand je clique sur un paramètre de la listbox ce dernier disparaît je en peux pas le sélectionner et donc le récupérer ....
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub UserForm_Initialize()
ActiveWorkbook.Worksheets("liste").Activate
Dim DerLig As Integer, i As Integer, j As Integer
DerLig = Range("A1000").End(xlUp).Row
ComboBox1.Clear
i = 2
Do While i <= DerLig
ComboBox1.AddItem Range("A" & i)
i = i + 1
Loop
Application.ScreenUpdating = False
With ActiveWorkbook.Worksheets("Factu_GALI").Activate
For j = 2 To 50 'si tu as 20 lignes
'si A1 est différent de B1
If nomConsultant = Cells(j, 2) Then plusieurspc = Cells(j, 4).Value
Next j
End With
End Sub |
Code:
1 2 3 4 5
| Private Sub ListBox1_Click()
ListBox1.Clear
ListBox1.AddItem plusieurspc
pc = ListBox1.Value
End Sub |