title: Getting unique values from the column
body: <p>I have this problem that I'm still not able to solve. I can probably use the <code>Application.Transpose</code> function but this will get all the unique values in the column. What I want to do is to get the unique value in the column if the other column values matches with the specific key.
  <a href="https://i.stack.imgur.com/Y85bc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y85bc.png" alt="enter image description here"></a></p>
  
  <p>If I use Application.Transpose, all the unique values in column C is taken. I only want to get the unique values in C if name of the student is <code>a</code>.And paste it in the column B of the newly added workbook.
  I've used this code to filter the unique values in B and paste it in the Column A of the newly added workbook.</p>
  
  <pre><code>dim var as variant
  dim lastrow as long
  dim obj as object
  
  set obj = CreateObject("Scripting.Dictionary")
  var = Application.Transpose(Range([B1], Cells(Rows.count, "B").End(xlUp)))
  
  For lastRow = 1 To UBound(var, 1)
      obj(var(lastRow)) = 1
  Next
  Set wb2 = Workbooks.Add
  
  Range("A1:A" &amp; obj.count) = Application.Transpose(obj.keys)
  </code></pre>
  
  <p>Any help is appreciated. Thanks!</p>