色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

VBA如何將一列數(shù)據(jù)中不重復(fù)的數(shù)據(jù)讀取到數(shù)組中

吉茹定2年前14瀏覽0評論

VBA如何將一列數(shù)據(jù)中不重復(fù)的數(shù)據(jù)讀取到數(shù)組中?

'利用字典去重,下面是示例代碼,去除第一列的重復(fù)項(xiàng)Sub Test() '利用字典去重,字典的特性是key值不能重復(fù) Dim Dic, Arr Dim i As Integer, r As Integer Dim Str As String r = Sheet1.Range("A65536").End(xlUp).Row If r = 1 Then Exit Sub '如果第一列沒有數(shù)據(jù)那么退出程序 Set Dic = CreateObject("scripting.dictionary") '創(chuàng)建字典對象 For i = 1 To r '將第一列數(shù)據(jù)添加到字典的key值中 Dic(CStr(Cells(i, 1))) = "" Next Arr = Dic.keys '返回字典key的數(shù)組 Set Dic = Nothing '銷毀對象 Str = Join(Arr, ",") '將數(shù)組中的內(nèi)容顯示為一字符串 MsgBox StrEnd Sub

數(shù)組 set java,VBA如何將一列數(shù)據(jù)中不重復(fù)的數(shù)據(jù)讀取到數(shù)組中