返回列表 上一主題 發帖

[發問] Dictionary之下,兩個Excel欄位聯合 作為判別條件

本帖最後由 GBKEE 於 2012-10-1 16:25 編輯

回復 1# yangjie
試試看
  1. Sub Ex()
  2.     Dim D As Object, R As Range
  3.     Set D = CreateObject("Scripting.Dictionary")
  4.     With Sheets("基本資料")
  5.         For Each R In .Range(.Cells(2, 3), .Cells(65536, 4).End(xlUp)).Rows
  6.             D(R) = ""
  7.         Next
  8.     End With
  9.     If D.Count = 0 Then Exit Sub
  10.     With ListBox1
  11.         .ColumnCount = 2
  12.         .List = Application.Transpose(Application.Transpose(D.keys))
  13.     End With
  14. End Sub
複製代碼

TOP

        靜思自在 : 多做多得。少做多失。
返回列表 上一主題