Sub UniqueValuesCopy()
Dim iArray As Variant
Dim RowCount As Long
With Sheet2
Sheets("Unique").Columns("B:B").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=.Range("D2"), Unique:=True
RowCount = .Cells(.Rows.Count, "B").End(xlUp).Row
iArray = .Range("B5:B" & RowCount)
End With
Dim iValue As String
Dim i As Integer
For i = 1 To UBound(iArray)
iValue = iValue & iArray(i, 1) & ","
Next
End Sub