- ©«¤l
- 559
- ¥DÃD
- 58
- ºëµØ
- 0
- ¿n¤À
- 626
- ÂI¦W
- 0
- §@·~¨t²Î
- win8
- ³nÅ骩¥»
- office2013
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- TW
- µù¥U®É¶¡
- 2010-11-22
- ³Ì«áµn¿ý
- 2024-6-14
|
¦^´_ 2# Hsieh
Hsieh ¤j¤j~ «Ü·PÁ§Aªº¦^ÂÐ~
³o´N¬O§Ú·Qn¤F¸Ñ¤Î·Qn§ó²`¤J¾Ç²ß¨ÓÀ³¥Îªº»yªk~
¥i¥H²q±o¥X¾ãÓ¼¶¼gªºÅÞ¿è,¦ý¤£²M·¡¤@¨Ç»yªkªº¨Ï¥Î¤è¦¡~
½Ð¤j¤j¯à¸ÑÄÀ¤@¤U~ À°¤p§Ì¸Ñ´b¤@¤U- Sub Ex()
- Set d = CreateObject("Scripting.Dictionary")
- '°ÝÃDCreateObject:«Ø¥ß¨Ã¶Ç¦^¹ï©ó ActiveX ª«¥óªº¤Þ¥Î¡C
- '["Scripting.Dictionary"]<==³o¬O¤°»ò·N«ä©O??
- '¦]¬°¤j¤j¦³¨Ç®ÉԥΪº¤è¦¡¡A«öF1¬O¬d¤£¨ìªº
- ar = Range("A1").CurrentRegion.Value
- 'CurrentRegion:¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥Ø«eªº°Ï°ì¡C¥Ø«e°Ï°ì¬O«ü¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº½d³ò¡C
- '¤p§Ì²qar¬O§_¬°¥ÑA1¶}©l¨ìªÅ¥ÕÃä¬ÉªºÀx¦s®æ½d³ò
- For i = 1 To UBound(ar, 1)
- 'UBound:ªí¥Ü«ü©w°}¦C¬Yºû³Ì¤j¥i¨Ï¥Îªº°}¦C¯Á¤Þ¡C
- '¥ÎUBound¨Ó§ì¨úar½d³ò¤@ºûªº³Ì¤j°}¦C¯Á¤Þ¡C
- If d(ar(i, 1)) = "" Then
- 'd ¬O²Ä¤@¥ySet d = CreateObject("Scripting.Dictionary")¤¤ªºd¡A¦ý¤£¤F¸Ñ«ç»ò¸ÑŪ¡C
- d(ar(i, 1)) = ar(i, 2)
- ElseIf InStr(d(ar(i, 1)), ar(i, 2)) = 0 Then
- 'InStr¬O¥Î¨Ó¤ñ¹ïd(ar(i, 1)), ar(i, 2)¬O§_¦³¤@¼Ëªº¸ê®Æ¡AY¨S¦³¤@¼Ë«hshow0,0=0´N¬Oªí¥Üar(i, 2)¬On·s¼Wªº
- d(ar(i, 1)) = d(ar(i, 1)) & "/" & ar(i, 2)
- End If
- Next
- [J:K] = ""
- [J1].Resize(d.Count, 1) = Application.Transpose(d.keys)
- [K1].Resize(d.Count, 1) = Application.Transpose(d.items)
- 'Application.Transpose(d.keys)»PApplication.Transpose(d.items) ´N¤@ÂIÀYºü¤]¨S¦³¡A¤£ª¾¹D«ç»ò¨Ï¥Î??
- End Sub
½Æ»s¥N½X |
|