Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Command1_Click() Dim choses choses = Array("A", "B", "C", "D", "E", "F") Dim nb As Integer, i As Integer, debut As Integer, fin As Integer, j As Integer, aa As String, bb As String, ps As Integer listbox1.Clear listbox1.Visible = False nb = UBound(choses) + 1 For i = 1 To nb listbox1.AddItem i Next debut = 0 fin = listbox1.ListCount - 1 Do For i = debut To fin aa = Val(listbox1.List(i)) If aa = 0 Then Exit Do bb = listbox1.List(i) ps = InStr(bb, "-") If ps Then listbox1.List(i) = choses(Val(bb) - 1) & Mid(bb, ps) Else listbox1.List(i) = choses(Val(bb) - 1) End If For j = aa + 1 To nb listbox1.AddItem j & "-" & listbox1.List(i) Next Next debut = fin + 1 fin = listbox1.ListCount Loop listbox1.Visible = True MsgBox listbox1.ListCount & " possibilités" End Sub