1) No loop but resulting String type array
Sub test()
Dim a
With Sheets("sheet1").Cells(1).CurrentRegion.Columns(1)
a = Filter(.Parent.Evaluate("transpose(if(countif(offset(" & _
.Address & ",0,0,row(1:" & .Rows.Count & "))," & .Address & ")=1," & _
.Address & ",char(2)))"), Chr(2), 0)
End With
End Sub
2) Returning Variant type array
Sub testDic()
Dim a, e
a = Sheets("sheet1").Cells(1).CurrentRegion.Columns(1).Value
With CreateObject("Scripting.Dictionary")
For Each e In a
.Item(e) = Empty
Next
a = .keys
End With
End Sub
Bookmarks