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

[µo°Ý] ½Ð±Ð~¨â­Ó¤u§@ªí, ´£¨ú¤£³sÄò¸ê®Æµ¹comboboxªºlist

[µo°Ý] ½Ð±Ð~¨â­Ó¤u§@ªí, ´£¨ú¤£³sÄò¸ê®Æµ¹comboboxªºlist

½Ð°Ý¦U¦ì¤j¤j, ¤p§Ì·Q±N¤£³sÄòªº¸ê®Æ´£¨ú¦Ücombobox¤¤, ¥H¤U¥N½X¥i¥H¿ì¨ì, ¦ý¬O¦³­Ó°ÝÃD´N¬O§Ú¤â¤Wªº¸ê®Æ¤À§O¦ì©ó¤u§@ªí1»P¤u§@ªí2¤¤, ¦Ó»Ý­n±N³o¨Ç¸ê®Æ´£¨ú¦Ü¦P¤@­Ócombobox.
  1.     Dim A As Range
  2.      Set d = CreateObject("Scripting.Dictionary")
  3.      With Workbooks("¬¡­¶Ã¯1.xlsx").Sheets("¤u§@ªí1")
  4.          .Activate
  5.          For Each A In .Range("A2", .[a1].End(xlDown))
  6.            d(A.Value) = IIf(d(A.Value) = "", A.Offset(, 1).Value, d(A.Value) & "," & A.Offset(, 1))
  7.          Next
  8.          ComboBox1.List = d.keys
  9.      End With
½Æ»s¥N½X
¨Ò¦p:
¤u§@ªí1:
«È¤áA
«È¤áA
«È¤áB
«È¤áC
«È¤áC
«È¤áC
«È¤áD
«È¤áD
«È¤áD

¤u§@ªí2:
«È¤áB
«È¤áB
«È¤áE
«È¤áE
«È¤áE
«È¤áF
«È¤áF
«È¤áF

³o¨â­Ó¤u§@ªí§Ú·Q±N«È¤áA,B,C,D,E,F¦U´£¨ú¤@­Ó§@¬°comboboxªº²M³æ.
½Ð°Ý¬O§_¦³¦ó«Øij¥i¥H«ü¾É¤@¤U¤p§Ì.
¸U¤À·PÁÂ!

¦^´_ 1# stevennanan
  1. Set d = CreateObject("Scripting.Dictionary")
  2. For Each sh In Sheets(Array("¤u§@ªí1", "¤u§@ªí2"))
  3.    With sh
  4.       For Each a In .Range(.[A2], .[A2].End(xlDown))
  5.          d(a.Value) = ""
  6.       Next
  7.    End With
  8. Next
  9. ComboBox1.List = d.keys
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh


    ¥i¥H¤F! «D±`·PÁÂ!:victory:

TOP

        ÀR«ä¦Û¦b : ¡i°±º¢¤£«e¡A²×µL©Ò±o¡j¤H³£°g©ó´M§ä©_ÂÝ¡A¦]¦Ó°±º¢¤£«e¡FÁa¨Ï®É¶¡¦A¦h¡B¸ô¦Aªø¡A¤]¤FµL¥Î³B¡A²×µL©Ò±o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD