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

¦r¨åÂX¥R¥Îªk(¦r¨å+¦Û­qª«¥óÃþ§O)

¦r¨åÂX¥R¥Îªk(¦r¨å+¦Û­qª«¥óÃþ§O)

¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-5-18 16:23 ½s¿è

¹ï©ó¸ê®Æ³B²z¨Ó»¡ "¦r¨å" ¬O¤@­Ó«D±`¦n¥Îªºª«¥ó¡A

¥i¥H§Ö³t¬d§ä»Ý­nªº¸ê®Æ¡AVBA¦Ñ¤âªÖ©w¤£­¯¥Í

¦ý¬O ¦r¨åªº®æ¦¡ 1­Ó Key ¥u¹ïÀ³1­Ó Item¡A¨S¦³ Item2,Item3,Item4........

¹ï©óVBA¦Ñ¤â¨Ó»¡¡A³o¤£¬O°ÝÃD¡A¥i¥Îªº¤èªk¤Ó¦h¤F

EX1:¥i¥H¥ÎItem ¬ö¿ý½s¸¹ ¡A¥ý¥Î¦r¨å¬d½s¸¹(²Ä1¨B)¡A¦A§Q¥Î½s¸¹¥h¬d·Q­n¸ê®Æ(²Ä2¨B)

EX2:©ÎªÌ§â"¤À¹j²Å¸¹"¤]¶ë¤J Item¡A¼´¥X¸ê®Æ«á(²Ä1¨B)¡A¦A°µ¸Ñ¦r¦ê(²Ä2¨B)¡A¸Ñ¥X·Q­nªº¸ê®Æ


¦ý¬O³o¨Ç¤èªk³£»Ý­n2¨B¨Ó¼´¥X»Ý­nªº¸ê®Æ¡A¹ï©óVBA·s¤â¨Ó»¡¡A¥i¯à´N¤ñ¸û¨S¨º»ò"ª½Ä±"¡A¬Ýµ{¦¡¤£©öÀ´

©Ò¥H§Ú"´£¨Ñ¦r¨å+¦Û­qª«¥óÃþ§O"ªº¤è¦¡¡A¨ÓÂX¥R¦r¨åªº Item

½Ð¸Ôªþ¥ó (¦r¨å+°}¦Cªº¥Îªk¥u¬O¶¶±a´£¨Ñ¡AVBA·s¤â¥i¯à¤ñ¸û¤£©öÀ´)


¦r¨åÂX¥R¥Îªk(¦r¨å+¦Û­qª«¥óÃþ§O).rar (36.49 KB)
1

µû¤À¤H¼Æ

µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

¦^´_ 1# n7822123

ÁÂÁ«e½ú¤À¨É±N¤@ºû°}¦C©ñ¤J¦r¨åitem¤¤
Sub ¿é¤J¸ê®Æ¨ì¦r¨å2()
Dim Arr As Range, Brr
Set D = CreateObject("Scripting.Dictionary")
Set Arr = Range([­û¤u¸ê®Æ!F1], [­û¤u¸ê®Æ!A1].End(xlDown))
For R = 2 To Arr.Rows.Count
  Key$ = Arr(R, 1)
  Brr = Arr(R, 2).Resize(, 5) 'Brr·|¬O­Ó2ºû¸ê®Æ°}¦C
  '¤p§Þ¥©-Brr°}¦C­°ºû«×  2ºû°}¦C=>1ºû°}¦C
  Brr = Application.Transpose(Application.Transpose(Brr))
  D(Key) = Brr   '§â°}¦C¸Ë¨ì¦r¨åªº "Item"
Next R
End Sub

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD