Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim nb As Integer, bout As Integer, i As Integer bout = List1.ListCount - 1 toto = List1.List(bout) For i = 0 To bout toto = List1.List(i) nb = 1 If i < bout - 1 Then Do While List1.List(i + 1) = toto nb = nb + 1 i = i + 1 Loop End If List2.AddItem toto & " " & nb Next
Dim nb As Integer, bout As Integer, i As Integer bout = List1.ListCount - 1 toto = List1.List(bout) For i = 0 To bout toto = List1.List(i) nb = 1 If i < bout Then Do While List1.List(i + 1) = toto nb = nb + 1 i = i + 1 If i = bout Then Exit Do Loop End If List2.AddItem toto & " " & nb Next
Dim i As Long, k As Long, sel As String, numb As Long, dej As String k = 0 While k <= List1.ListCount - 1 'element qu'on va controlé sel = List1.List(k) 'nombre de répétion numb = 0 'vérifier si on a déja controlé cet item ou pas If Not (InStr(1, dej, Chr(9) & sel) >= 1) Then 'sinon on le controle For i = 0 To List1.ListCount - 1 If List1.List(i) = sel Then numb = numb + 1 dej = dej & Chr(9) & sel End If Next List2.AddItem sel & " " & numb End If k = k + 1 DoEvents Wend
k = 0 While k <= List1.ListCount - 1 sel = List1.List(k) numb = 1 For i = k + 1 To List1.ListCount - 1 If List1.List(i) = sel Then numb = numb + 1 k = k + 1 End If Next List2.AddItem sel & " " & numb k = k + 1 Wend
Dim nb As Integer, bout As Integer, i As Integer bout = List1.ListCount - 1 toto = List1.List(bout) For i = 0 To bout toto = List1.List(i) nb = 1 If i < bout Then Do While List1.List(i + 1) = toto nb = nb + 1 i = i + 1 If i = bout Then Exit Do Loop End If List2.AddItem toto & " " & nb Next
Dim i As Long, k As Long, quoi As String, bout As Long, nb As Long, toto() As String bout = List1.ListCount - 1 ReDim toto(bout) As String For i = 0 To bout toto(i) = List1.List(i) Next For i = 0 To UBound(toto) quoi = toto(i) toto(i) = Chr(0) nb = 1 If quoi <> Chr(0) Then For k = i + 1 To UBound(toto) If toto(k) = quoi Then nb = nb + 1 toto(k) = Chr(0) End If Next List2.AddItem quoi & " " & nb End If Next
Par contre, est-il possible de faire afficher le chiffre toujours dans la list2 mais dans une colonne différente.Le noms dans le additem de la list2 et sa quantité dans la colonne 2 de la list2 aussi.