Dim Myarr() As String
Dim sum As Integer
Dim M As String
Public Sub test()
' 1 遍历Range
M = Cells(2, 5)
For Each R In Range("E3:E8")
M = M & "," & R.Value
Next
Myarr = Split(M, ",") ' Split 可以直接产生Arr
MsgBox UBound(Myarr) - LBound(Myarr) + 1 'Arr元素个数
Set d = CreateObject("scripting.dictionary")
sum = 0
For Each i In Myarr ‘遍历数组
If Not d.exists(i) Then d.Add i, ""
Next
M = ""
For Each K In d.Keys '遍历字典
M = M & ";" & K
Next
Cells(13, 5) = M
End Sub