doublons at affichage dans un msgbox ?

arvin

XLDnaute Occasionnel
bonjour à tous

voilà j'ai un souci : cette macro repère les doublons et affiche le résultat dans un msgbox . Jusque là c'est ok

le hic c'est que cela devient ingérable car il y a trop de doublons (que je ne souhaite pas supprimer)

est il possible d'afficher le résultat sous une autre forme (userform avec combo par exemple)

je n'y arrive pas

merci et bonne journée


Sub CompterLesNomsIdentiques()
Dim Cell As Range
Dim Ligne As Integer, I As Integer
Dim M As Byte
Dim U As Boolean
Dim Tableau()
Dim Resultat As String

Ligne = Range('A65536').End(xlUp).Row
M = 1
ReDim Preserve Tableau(2, M)

For Each Cell In Range('B2:B' & Ligne)
U = False
For I = 1 To M
If Cell = Tableau(0, I - 1) Then
Tableau(1, I - 1) = Tableau(1, I - 1) + 1
U = True
End If
Next I

If Tableau(1, M - 1) = '' And U = False Then
Tableau(0, M - 1) = Cell
Tableau(1, M - 1) = 1
M = M + 1
ReDim Preserve Tableau(2, M)
End If
Next Cell

For I = 1 To M - 1
Resultat = Resultat & Tableau(0, I - 1) & Chr(9) & Tableau(1, I - 1) & Chr(10)
Next I
MsgBox Resultat

End Sub
 

arvin

XLDnaute Occasionnel
voici un exemple du fichier

merci [file name=doublonaffichage.zip size=9921]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/doublonaffichage.zip[/file]
 

Pièces jointes

  • doublonaffichage.zip
    9.7 KB · Affichages: 30

Hervé

XLDnaute Barbatruc
salut arvin, le forum

Une tentative de réponse en pièce jointe.

Salut [file name=doublonaffichage_20051130130759.zip size=12952]http://www.excel-downloads.com/components/com_simpleboard/uploaded/files/doublonaffichage_20051130130759.zip[/file]
 

Pièces jointes

  • doublonaffichage_20051130130759.zip
    12.6 KB · Affichages: 38

Discussions similaires

Réponses
6
Affichages
248
Réponses
5
Affichages
197

Statistiques des forums

Discussions
312 326
Messages
2 087 311
Membres
103 513
dernier inscrit
adel.01.01.80.19