ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Dictionary¤§¤U,¨â­ÓExcelÄæ¦ìÁp¦X §@¬°§P§O±ø¥ó

[µo°Ý] Dictionary¤§¤U,¨â­ÓExcelÄæ¦ìÁp¦X §@¬°§P§O±ø¥ó

½Ð±Ð¤j¤j :
         Set d = CreateObject("Scripting.Dictionary")
                   With Sheets("°ò¥»¸ê®Æ")
                       For Each a In .Range(.Cells(2,3), .Cells(65536, 4).End(xlUp))
                           d(a & "") = ""
                       Next
                  End With
        If d.Count = 0 Then Exit Sub
     ListBox1.list = d.keys
µ²ªG list ¬°¨â­ÓExcelÄæ¦ì¦U¦Û¬Û²§item  ¼g¦b¦P¤@list Column¤¤
½Ð±Ð¤j¤j  À³¦p¦ó¼gªk   ¥i±N ¨â­ÓExcelÄæ¦ìÁp¦X  §@¬°§P§O±ø¥ó
  ¦p   ListBox1.list = d.keys
±o¨ì   
            ¼Æ¾Ç       9¤ë2¤é
            ¼Æ¾Ç       9¤ë3¤é
            ­^¤å       9¤ë2¤é
ÁÂÁ«ü¾É

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-10-1 16:25 ½s¿è

¦^´_ 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
½Æ»s¥N½X

TOP

  1. Sub Ex()
  2.     Dim D As Object, R As Range
  3.     Set D = CreateObject("Scripting.Dictionary")
  4.     With Sheet1
  5.         For Each R In .Range(.Cells(2, 3), .Cells(65536, 4).End(xlUp)).Rows
  6.             D(R.Cells(1) & R.Cells(2)) = 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.items))
  13.     End With
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# chin15
½Ð±Ð  chin15  ¤j¤j
     ÁÂÁ«ü¾É
   ­ì¥ý¥ÎComboBox1«Ø¥ß¤F  list  ±µªÌ¿é¥X  À³¦p¦ó¿é¤J¨ìlistbox1¤¤2­Ócolumn¤º
Private Sub ComboBox1_DropButtonClick()
    If ComboBox1.Text = "" Then Exit Sub
    ListBox1.AddItem ComboBox1.Text    ------¥u¥X²{¤@¶µ  ¦p¦ó¤~¥i¥X²{¨â¶µ
     ComboBox1.RemoveItem (ComboBox1.ListIndex)
    ComboBox1.ListIndex = -1
End Sub

TOP

¦^´_ 2# GBKEE
ÁÂ GBKEE ¤j¤j
¸g´ú¸Õ
                   For Each R In .Range(.Cells(2, 3), .Cells(65536, 4).End(xlUp)).Rows
                          D(A) = ""
------
                   .List = Application.Transpose(Application.Transpose(D.keys))
®ÄªG ¥X²{­«½Æ
¨Ï¥Î  3# ¤j¤j  ¥i±o  ¤£­«½Æ¤§µ²ªG
¦ý¦¹¨âÄæ ¸gclick ¨ì¥t¤@­Ólistbox2¤¤    .additem    listbox.text
«o¶È±o¤@Äæ    ¦p¦ó¥i±o¨ì¨âÄæ

TOP

¦^´_ 4# yangjie
¦Û¤v­×¥¿¦¨  
Private Sub ComboBox1_DropButtonClick()
    If ComboBox1.Text = "" Then Exit Sub
    ListBox1.AddItem ComboBox1.List(ComboBox1.ListIndex, 0)
    ListBox1.List(ListBox1.ListCount - 1, 1) = ComboBox1.List(ComboBox1.ListIndex, 1)
    ComboBox1.RemoveItem (ComboBox1.ListIndex)
    ComboBox1.ListIndex = -1
End Sub
¥i¦³§ó²³æ¤§»yªk?

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD