title: VBA: Removing duplicates from a Collection
body: <p><a href="http://i.stack.imgur.com/3Xw8W.jpg" rel="nofollow">What I am trying to accomplish</a></p>
  
  <p>I'd like to take a series of values from a selection of cells, then fill a new cell which contains only unique values from the selection I made. here is my code so far:</p>
  
  <pre><code>Const Delimiter = ", "
  Dim num As Range
  Dim a As Variant
  Dim Concat, bucket As New Collection
  
  #to create a collection that contains all the values from my selection 
  For Each num In Selection
    a = Split(num, Delimiter)
    Concat.Add (a)
  Next num
  
  #to convert multidimensional collection to a single dimensional
  For i = 1 To Concat.Count
    For j = 1 To Concat(i).Count
      bucket.add(Concat(i)(j))
    Next i
  Next j
  
  #to remove duplicate values
  [code]
  
  #to output to excel
  [code]
  </code></pre>
  
  <p>As you can see, the code is incomplete. I am having issues with the following lines of code</p>
  
  <pre><code>For j = 1 To Concat(i).Count
  </code></pre>
  
  <p>I get a "Run-time error '424': Object required" error.</p>