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

[µo°Ý] ¦³±ø¥óªº²Î­p

¦^´_ 13# gctsai

§Ú·Q§A¬Oµ{¦¡½X©ñ¿ù¼Ò²Õ§a!
ª`·NGBKEE´£¥Ü¸Óµ{¦¡½X¥²¶·¸m©ñ¦b¨Ó·½¤u§@ªí¼Ò²Õ¤º
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

§ï¥ÎWorksheet_Calculate¨Æ¥ó¸Õ¸Õ

TOP

¤j¤j§Ú¦b"¨Ó·½"¼W¥[¤F¤@¦C¸ê®Æ¦p¤U
  A                B                   C
¤T¬v        D25-MOTO        NOKIA
¥i¬O"²Î­p"¤]¨S¦³¦Û°Ê¦A­pºâ¤@¦¸,¦Ó¬O­n¦b°õ¦æ¤@¦¸¥¨¶°«á¤~·|±q·s­pºâ

TOP

¦^´_ 11# gctsai
¨Ï¥Î¤u§@ªíªº¹w³]¨Æ¥óWorksheet_Change,³o¬O§Aªþ¥óSheets("¨Ó·½")ªºµ{¦¡½X.
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  2.     Ex
  3. End Sub
  4. Private Sub Ex()
  5.     Dim D As Object, Rng As Range
  6.     Set D = CreateObject("SCRIPTING.DICTIONARY") '³]¥ß¦r¨åª«¥ó
  7.     Set Rng = Sheets("¨Ó·½").[A2]                                       '³]¥ßÀx¦s®æª«¥ó
  8.     With Sheets("²Î­p")
  9.         Do While Rng <> ""        'Rngªº­È¬°ªÅ¥Õ®É¤£°õ¦æ Doªº°j°é
  10.             If Rng = .[A2] Then D(Rng.Offset(, 1).Value) = D(Rng.Offset(, 1).Value) + 1
  11.             '        .[A2] ->Sheets("²Î­p")[A2]      '¦r¨åª«¥ó(KEY)=ITEM + 1
  12.             Set Rng = Rng.Offset(1)  'Rng¤U²¾¤@¦C¦ì
  13.         Loop
  14.         With .[B2:C2]
  15.             .Cells(1).Resize(D.Count) = Application.Transpose(D.KEYS)
  16.             .Cells(2).Resize(D.Count) = Application.Transpose(D.ITEMS)
  17.             .Resize(D.Count, 2).Sort Key1:=.Cells(1), Order1:=xlAscending, Header:=xlNo
  18.         End With
  19.     End With
  20.     Set D = Nothing
  21.     Set Rng = Nothing
  22. End Sub
½Æ»s¥N½X

TOP

¤j¤j¥t¥~¦pªG§Ú·Q­n¦b¸ê®Æ¦³Åܧó©Î¼W¥[®É¦Û°Ê§ó·sµ²ªG©O?

TOP

ÁÂÁÂGBKEE¤j¤j
¤w¸g¥i¥H¥Î¤F,¦Ó¥BÁÙ¥i¥Hª½±µ§â±ø¥ó(¦p"¤T¬v")¥´¦bvba¤º

TOP

¦^´_ 8# gctsai
¸Õ¸Õ¬Ý
  1. Sub Ex()
  2.     Dim D As Object, Rng As Range
  3.     Set D = CreateObject("SCRIPTING.DICTIONARY") '³]¥ß¦r¨åª«¥ó
  4.     Set Rng = Sheets("¨Ó·½").[A2]                                       '³]¥ßÀx¦s®æª«¥ó
  5.     With Sheets("²Î­p")
  6.         Do While Rng <> ""        'Rngªº­È¬°ªÅ¥Õ®É¤£°õ¦æ Doªº°j°é
  7.             If Rng = .[A2] Then D(Rng.Offset(, 1).Value) = D(Rng.Offset(, 1).Value) + 1
  8.             '        .[A2] ->Sheets("²Î­p")[A2]      '¦r¨åª«¥ó(KEY)=ITEM + 1
  9.             Set Rng = Rng.Offset(1)  'Rng¤U²¾¤@¦C¦ì
  10.         Loop
  11.         With .[B2:C2]
  12.             .Cells(1).Resize(D.Count) = Application.Transpose(D.KEYS)
  13.             .Cells(2).Resize(D.Count) = Application.Transpose(D.ITEMS)
  14.             .Resize(D.Count, 2).Sort Key1:=.Cells(1), Order1:=xlAscending, Header:=xlNo
  15.         End With
  16.     End With
  17.     Set D = Nothing
  18.     Set Rng = Nothing
  19. End Sub
½Æ»s¥N½X

TOP

1.¤j¤j§Úªº°ÝÃD¬O­n¦p¦ó¥Îvba°µ(¦pªþÀÉ)
2.­n¦p¦ó±q¨Ó·½ªº¤u§@­¶¤¤²Î­p¥X"¤T¬v"¤½¥qªº§Ç¸¹¥X²{ªº¦¸¼Æ
3.¨ä¤¤±ø¥ó"¤T¬v"¬O¤£¥ÎÅã¥Üªº
4.¦]¬°¦³«Ü¦hÀɮצpªG¥Î¼Ï¯Ã¤ÀªRªº¸Ü­n¨C¤@­ÓÀɮ׳£°µ,­«ÂI¬OÀÉ®×·|Åܫܤj
text.rar (4.68 KB)

TOP

¦^´_ 6# gctsai
VBAµ{§Ç¬O­n¶q¨­®M»sªº,©Ò¥HªþÄÒ¤W¨Ó³W©w±ø¥ó­n©ñ¨º¸Ì»¡©ú¥Õ, ¦^µª¤~·|©ú½T.

TOP

ÁÂÁÂGBKEE¤j¤j
1.¦]¬°¥uª¾¹D¤½¥q¤Î¤ë¥÷¦Ó«~¦Wªº¦WºÙ¤ÎºØÃþµLªkª¾¹D(¦p¥i¯à·|¦³¼W¥[»ñ±ù,Às²´¤§Ãþªº)
2.¦]¬°§Ú¥Ø«e¦³50­ÓÃþ¦üªºÀÉ®×,¤£·Q¤@­Ó­ÓÀÉ®×¥h°µ,©Ò¥H¤~·Q»¡¥Îvbaªº

TOP

        ÀR«ä¦Û¦b : ¯à·F¤£·F¡A¤£¦p­W·F¹ê·F¡C
ªð¦^¦Cªí ¤W¤@¥DÃD