LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Sorting a collection. *Leaving Duplicates*

John Walkenbach uses the following code to sort a collection and to
remove duplicates.

Can it be modified to set a collection but to leave duplicates ?


Thanks.

' Using Walkenbach's NoDupes variable name eventhough duplicates are to
be preserved

For i = 1 To NoDupes.Count - 1
For j = i + 1 To NoDupes.Count
If NoDupes(i) NoDupes(j) Then
Swap1 = NoDupes(i)
Swap2 = NoDupes(j)
NoDupes.Add Swap1, befo=j
NoDupes.Add Swap2, befo=i
NoDupes.Remove i + 1
NoDupes.Remove j + 1
End If
Next j
Next i

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete all dulplicate rows leaving no record of the duplicates nozzaworld Excel Discussion (Misc queries) 3 February 22nd 10 08:33 PM
Sum Duplicates without Sorting Zesty Excel Worksheet Functions 3 October 16th 09 12:00 AM
delete a duplicate in column while leaving other duplicates daphoenix Excel Worksheet Functions 1 June 25th 08 04:15 PM
Finding Duplicates in a Column (Without Sorting) ConfusedNHouston Excel Discussion (Misc queries) 3 February 14th 07 02:24 PM
When sorting, how would I omit duplicates? Blaine Fray New Users to Excel 2 August 23rd 05 06:46 PM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"