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

Ãö©óScripting.Dictionary°£¤F¹LÂo­«½Æ­È¡A¬O§_¥i¥H¦P®É©¿²¤ªÅ­È¡H

Ãö©óScripting.Dictionary°£¤F¹LÂo­«½Æ­È¡A¬O§_¥i¥H¦P®É©¿²¤ªÅ­È¡H

°ÝÃD.rar (55.16 KB)

¥¿±`®É·|¹LÂo­«½Æ


·í¥X²{ªÅ­È®É«h²§±`



ÁÙ¬O»¡¤£¾A¦X¨Ï¥ÎScripting.Dictionary¡H

¦^´_ 1# av8d

«ØijªÅ¥Õ¥i¥Hª½±µ±Æ°£¡AÁÂÁÂ

TOP

¦^´_ 2# samwang


    »¡¨ÓºF·\¡A³o¬qµ{¦¡½X¬O¥Ñºô¸ô½Æ»s¶K¨Óªº¡A
    §Ú§V¤O¾Ç²ß¤Î²z¸Ñ¤¤¡AÁÂÁ©âªÅ¸Ñµª¡C

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2021-10-6 01:21 ½s¿è

¦^´_ 2# samwang

¬ã¨s¤F³\¤[¡A¤]³z¹L·j¯Á"Scripting.Dictionary"¡A¬d¬Ý¤FÃö©ó±zªº½d¨Ò
¦ýÁÙ¬OµLªk±ÀºV¥Xµ²ªG¡AÁٽнç±Ð¡A

¦]¬°ªÅ­ÈÀH®É·|³Q¶ñ¤J¸ê®Æ¡A©Ò¥H¬O§_¯à¼È®É©¿²¤¡A
¦ý¬O·í¶ñ¤J®É¡A´N·|ºâ¤J¡C

TOP

¦^´_ 4# av8d

¦]¬°ªÅ­ÈÀH®É·|³Q¶ñ¤J¸ê®Æ¡A©Ò¥H¬O§_¯à¼È®É©¿²¤¡A
¦ý¬O·í¶ñ¤J®É¡A´N·|ºâ¤J¡C
>>§ó§ï¦p¤U¡AÁÂÁÂ
For Each A In .Range("B4", .[B65536].End(xlUp))
            If A.Value = "" Then GoTo 99
            d(A.Value) = ""
  '¥u¨úBÄ椣­«½Æ­È
            'd(A.Value) = IIf(d(A.Value) = "", A.Offset(, 1).Value, d(A.Value) & "," & A.Offset(, 1))
99:     Next

TOP

¦^´_ 5# samwang

  ÁÂÁ«e½ú¡A¯uªº¬OÁŵM¶}®Ô¡A¾Ç²ß¤F³\¦h·sª¾ÃÑ¡A¥Ñ°J·PÁ¡C

TOP

For Each A In .Range("B4", .[B99].End(xlUp))
            'd(A.Value) = IIf(d(A.Value) = "", A.Offset(, 1).Value, d(A.Value) & "," & A.Offset(, 1))
            If A.Value <> "" Then d(A.Value) = "" '±Æ°£ªÅ­È
Next
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2021-10-15 15:05 ½s¿è

¦^´_ 7# ML089

¨Ï¥Î«áµo²{·|«O¯dªÅ­È¤@­Ó¡A
­ì¨Ó¤]¥i¥H³o¼Ë¼g¡A¸U¤À·PÁ¡A¾Ç²ß¤F¡C

TOP

ÁÂÁ½׾Â,ÁÂÁ¦U¦ì«e½ú
«á¾ÇÂǦ¹©«¾Ç²ß¨ì²M³æª¾ÃÑ»P¦r¨åªº¹B¥Î,¾Ç²ß¤è®×¦p¤U,½Ð¦U¦ì«e½ú«ü±Ð

ÂI¿ï²M³æµ²ªG:



Option Explicit
Private Sub ComboBox1_Change()
Dim A As Range, d As Object
Set d = CreateObject("Scripting.Dictionary")
With Sheets("§Úªºª¾ÃÑ®w")
   For Each A In .Range("B4", .[B65536].End(xlUp)).SpecialCells(2)
      d(A.Value) = ""
   Next
   ComboBox1.List = d.keys
End With
End Sub

Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    'IJµoComboBox1_Change
    ComboBox1.Value = "."
    ComboBox1.Value = ""
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¦^´_ 6# av8d


    If d.exists("") Then d.Remove ""

TOP

        ÀR«ä¦Û¦b : «Ý¤H°h¤@¨B¡A·R¤H¼e¤@¤o¡A´N·|¬¡±o«Ü§Ö¼Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD