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

ÁÙ¬O¸ê®Æ¤ñ¹ïªº°ÝÃD~

ÁÙ¬O¸ê®Æ¤ñ¹ïªº°ÝÃD~

¤£¦n·N«ä°ÝÃD¦p¤U

§Æ±æ±NA +B +CÄæ¦ì­«½Æ¨ìªº¸ê®Æ§R°£ ½Æ»s¨ì EFGÄæ¦ì
»Ý­n A+ B+ C  ³£­n¤ñ¹ï¦³­«½Æ ¤~¯à½Æ»s¨ìEFG
ÁÂÁ¦U¦ì¤j¤j¤F~

Q.jpg (20.38 KB)

Q.jpg

¦^´_ 1# ffntldj
¸Õ¸Õ¬Ý
  1. Sub Ex()
  2.     Dim D As Object, Rng As Range, R As Range, Ar()
  3.     Set D = CreateObject("SCRIPTING.DICTIONARY")                       '³]¥ßDICTIONARYª«¥ó
  4.     Set Rng = [A1:C9]                                                  '«ü©w½d³ò
  5.     For Each R In Rng.Rows                                             'Rows «ü©w½d³òªº¨C¤@¦C
  6.         Ar = Application.Transpose(Application.Transpose(R.Cells.Value)) '±NRÂà¸m¤G¦¸Âà´«¬°¤@ºû°}¦C
  7.         D(Join(Ar, ",")) = Ar        'DICTIONARYª«¥ó KEY ->Join(AR, ",")  ,DICTIONARYª«¥ó ITEM->Ar
  8.     Next
  9.     [E1].Resize(D.Count, Rng.Columns.Count) = Application.Transpose(Application.Transpose(D.items))
  10.     'D.Count-> DªºÁ`¼Æ,         Rng.Columns.Count->RngÄæ¦ìªºÁ`¼Æ.
  11.     '¨C¤@ D.ITEM ¬O¬°¤@ºû°}¦C   D.ITEMs ->D.ITEMªº¶°¦X.
  12.     'Application.Transpose(Application.Transpose(D.ITEMS)) ->±ND.ITEMS Âà¸m¤G¦¸«á¬°¤G¬°°}¦C
  13. End Sub
½Æ»s¥N½X

TOP

³o­Ó¸û«Øij¥Î¶i¶¥¿z¿ï
¥[¤WÄæ¼ÐÃD¡A¶i¶¥¿z¿ï~¤Ä¿ï"¿ï¤£­«½Æ¸ê®Æ"
AA.gif

TOP

¥»©«³Ì«á¥Ñ ffntldj ©ó 2011-9-15 23:42 ½s¿è

ÁÂÁª©¤j¡ã µ{¦¡½X¦³ÂIÃø §Ú·|¦A¬ã¨s¤@¤U
¥t¥~¦h°Ý¤@­Ó°ÝÃD ¦pªGABCÄæ¦ì¸ÌÀYªº¸ê®Æ½d³ò¬O¤£©T©wªº©O¡H¡]¤£¥u¨ì9¦C¡^
Set Rng = [A1:C9]   ³o­n«ç»ò­×§ï¡H ÁÂÁ§A¤F¡ã
TO ¶W¯Åª©¥D
¤@©w±o¥ÎVBA@@ ¨S¦³¿ìªk ÁÂÁ§Aªº±Ð¾É §Ú¦h¾Ç¤@¼Ë ÁÂÁÂ

TOP

¦^´_ 4# ffntldj
Set Rng = Range("A1").CurrentRegion
CurrentRegion ÄÝ©Ê->¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥Ø«eªº°Ï°ì¡C¥Ø«e°Ï°ì¬O«ü¥H¥ô·NªÅ¥Õ¦C¤ÎªÅ¥ÕÄ檺²Õ¦X¬°Ãä¬Éªº½d³ò¡C°ßŪ¡C

Set Rng = Range("A1", Range("C1").End(xlDown))
End ÄÝ©Ê-> ¶Ç¦^ Range ª«¥ó¡A¸Óª«¥ó¥Nªí¥]§t¨Ó·½½d³ò¤§°Ï°ìµ²§À³BªºÀx¦s®æ¡Cµ¥©ó«ö END+¦V¤WÁä¡BEND+¦V¤UÁä¡BEND+¦V¥ªÁä©Î END+¦V¥kÁä¡C°ßŪ Range ª«¥ó¡C

TOP

·PÁ¡I µ{¦¡½X¬ÝÀ´¤F «Ü±j¤j¡I ÁÂÁª©¤j¡ã

TOP

        ÀR«ä¦Û¦b : §g¤l¥ß«í§Ó¡A¤p¤H«í¥ß§Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD