LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default Trouble with Arrays / Collections

Tom,

you could also try the "Dictionary" attack. It needs a reference to the
windows scripting runtime to work:

Sub RemoveDuplicates()
Dim Rng As Range, Cell As Range
Dim List As New Dictionary
Dim i As Integer

' The items are in A1:A10
Set Rng = Application.Range("B2:B20")

For Each Cell In Rng
With Cell
If List.Exists(.Value) Then
List(.Value) = List(.Value) & "," & .Address(0, 0)
Else
List.Add .Value, .Address(0, 0)
End If
End With
Next Cell

' Print out the list is the Immediate window

For i = 0 To List.Count - 1
Debug.Print List.Items()(i), List.Keys()(i)
Next i

End Sub

Dm Unseen



 
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
Collections of Collections David Morton Excel Programming 6 November 13th 04 01:10 AM
Help with collections ksnapp[_45_] Excel Programming 1 April 7th 04 12:42 AM
Using Collections Kerry[_4_] Excel Programming 1 January 25th 04 04:08 PM
Collections Lookups Dave Curtis[_3_] Excel Programming 1 December 3rd 03 09:15 AM
Comparing Collections Tom Ogilvy Excel Programming 1 September 17th 03 06:15 PM


All times are GMT +1. The time now is 04:16 AM.

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"