Bonjour à tous,
Voilà, le contexte est
une userform avec 4 listbox choix multiples pour 4 familles de choix avec chacunes 3 lignes.
Je souhaite récupérer les valeurs choisies dans une variable qui sera écrite dans une case.
Pour le moment, j'ai ça comme code qui tourne pour récupérer les données...
C'est loin d'être beau mais ça semble fonctionner...
Vous pourriez m'aider à l'optimiser?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 'Boucle 1 Jlbx1 = 0 For Ilbx1 = 0 To 2 If ListBox1.Selected(Ilbx1) Then Jlbx1 = Jlbx1 + 1 txtlbx1 = txtlbx1 & "/" & ListBox1.List(Ilbx1) End If Next Jlbx2 = 0 For Ilbx2 = 0 To 2 If ListBox2.Selected(Ilbx2) Then Jlbx2 = Jlbx2 + 1 txtlbx2 = txtlbx2 & "/" & ListBox2.List(Ilbx2) End If Next Jlbx3 = 0 For Ilbx3 = 0 To 2 If ListBox3.Selected(Ilbx3) Then Jlbx3 = Jlbx3 + 1 txtlbx3 = txtlbx3 & "/" & ListBox3.List(Ilbx3) End If Next Jlbx4 = 0 For Ilbx4 = 0 To 2 If ListBox4.Selected(Ilbx4) Then Jlbx4 = Jlbx4 + 1 txtlbx4 = txtlbx4 & "/" & ListBox4.List(Ilbx4) End If Next ActiveCell.Value = txtlbx1 & txtlbx2 & txtlbx3 & txtlbx4
Et cerise sur le gateau, comment je peux supprimer le premier caractère qui est systématiquement un "/"...
Merci
Partager