Excel VBA 篩選出不重覆資料

底下程式用一欄來當資料陣列
再用 Collection 來存放資料
-------------------------------------------
Dim CollectArr As New Collection
Dim something As Variant
Dim DataArray() As Variant
DataArray() = Sheet1.Range(Sheet1.Cells(1, key), Sheet1.Cells(RowCount, key))

On Error Resume Next

For Each something In DataArray
    CollectArr.Add something, something
Next

2 則留言: