VBA如何刪除數(shù)組中重復(fù)的值?
使用集合Collection的key唯一性除去重復(fù)的值Sub A() Dim A(1 To 100) Dim b As New Collection Dim i As Integer A(1) = 1 A(2) = 3 A(3) = 5 A(4) = 7 A(5) = 3 A(6) = 5 A(7) = 2 On Error Resume Next For i = 1 To 100 b.Add A(i), Str(A(i)) Next i For i = 1 To b.Count A(i) = b(i) Next iEnd Sub
下一篇js游戲引擎排名