I have this problem that I'm still not able to solve. I can probably use the Application.Transpose 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.

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 a.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.
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" & obj.count) = Application.Transpose(obj.keys)
Any help is appreciated. Thanks!

1.Copy Data to a temp sheet.2.Select Col A and Col B3.Data | Remove Duplicates.4.AutoFilter on Col A for the relevant name