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

­ì¸ê®Æ¦p¦ó¥Î¦r¨å©î¤À¡A¤J¤£³sÄòªºÄæ¦ì

½Ð°Ý­ã¤j¡G
Ar = Array(1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26) '¨Ó·½¸ê®Æ­n½Æ»sªº[Äæ¦ì]¶¶§Ç
Br = Array(1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19) '­n¶K¤Jªº[Äæ¦ì]¶¶§Ç
¦pªG¶K¤J¶¶§Ç§ï¦¨³o¼Ë¡A¦p¦ó§ïfor next?
§Æ±æ¤ä«ù!

TOP

¦^´_ 11# s7659109


¤@¼Ë¬O
For i = 0 To UBound(Ar)

TOP

­ã¤j¡G
«üAr = Array(    ¡^»P¡ABr = Array(¡^¡A¡]¡^¤º¥i§_¥HÅܼƥN´À¡A¤£­n¼g³o»òªø¡C
§Æ±æ¤ä«ù!

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-10-2 22:33 ½s¿è

¦^´_ 13# s7659109


   ¨Ó·½¸ê®Æ»P­n¶K¤Jªº¸ê®Æ¡A»Ý­n«Ø¥ß1-1¹ïÀ³Ãö«Y

   ¦pªG¨S¦³³W«ßªº¸Ü¡AÀ³¸Ó¬O¨S¿ìªk¥ÎÅܼƨú¥Nªº

  °£«D­n¼g§PÂ_¦¡§ä¥X2­Ó¤u§@ªíªº¹ïÀ³Ãö«Y¡A³o¼Ë´N¸ò§Aªº©RÃD:¤£»Ý§PÂ_½Ä¬ð¤F¡C
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-10-2 23:25 ½s¿è

¦^´_ 14# n7822123


ÆF¥ú¤@°{¡A³o¼ËÀ³¸Óº¡·N¤F§a!?
µ{§Ç:test2
  1. Sub test2()
  2. Set d = CreateObject("scripting.dictionary")
  3. Dim Rn&, Cn&, arr
  4. Sheets("data").Activate
  5. Rn = Sheet2.Cells(Rows.Count, 1).End(xlUp).Row
  6. Cn = Cells(1, Columns.Count).End(xlToLeft).Column
  7. For C = 2 To Cn: d(Cells(1, C).Value) = Cells(2, C).Resize(Rn - 1, 1): Next C
  8. Sheets("test").Activate: Cn = Cells(1, Columns.Count).End(xlToLeft).Column
  9. For C = 2 To Cn: Cells(2, C).Resize(Rn - 1, 1) = d(Cells(1, C).Value): Next C
  10. End Sub
½Æ»s¥N½X
¨Ï¥Î数组©M¦r¨å1071002+.rar (12.29 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¥»©«³Ì«á¥Ñ s7659109 ©ó 2018-10-3 08:27 ½s¿è

ªüÀs¤j¡G
¸g´ú¸Õµ²ªG¡A¤´¹F¤£¨ì¹w´Á¡A¦pªþÀÉ¡C

¨Ï¥Î数组©M¦r¨å1071003.zip (12.75 KB)

§Æ±æ¤ä«ù!

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-10-4 01:33 ½s¿è

¦^´_ 16# s7659109


½Ð¨Ï¥Î§Aªþ¥ó¸Ì­±ªº "test2"µ{§Ç!

test1 »P test2 ³£¥i¥H²Å¦X§Aªº»Ý¨D¡A¤£¦P¼gªk
test1 ³Ì¼u©Ê¡A¾Ç¸¹¤]¤£³sÄò¤]¥i¥H!

sheet2.test µ{§Ç¬O§A¦Û¤v­ì¥»ªº!
¦³ÂIµL¨¥.....

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

TOP

ªüÀs¤j¡G
µ§¼Æ30000µ§¡A·í¤F¡C
§Æ±æ¤ä«ù!

TOP

¦^´_ 13# s7659109

Ar = Array(1, 2, 3, 4, 5, 6, 7, 8, 18, 19, 20, 21, 22, 23, 24, 25, 26)
Br = Array(1, 2, 3, 4, 5, 6, 7, 8, 11, 12, 13, 14, 15, 16, 17, 18, 19)

¦pªG¬O¹³¤W­±³o¼Ë[¨â¬q¦¡]ªº³sÄòÄæ¦ì:
Cells(2, 1).Resize(R, 8) = xA(2, 1).Resize(R, 8).Value
Cells(2, 18).Resize(R, 9) = xA(2, 11).Resize(R, 9).Value

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2018-10-4 11:25 ½s¿è

¦^´_ 18# s7659109

À³¸Ó¤£¬O·í¤F¡A3¸Uµ§­n°õ¦æ¤@¬q®É¶¡!
¦r¨åª«¥óªºkey¿é¤J¦r¦ê«¬ºA¥i´£¤É³t«×(³o¤]¬O¸ò·Ç¤j¾Ç²ßªº)
test1 ¤£»Ý­×§ï
µ{§Ç test2­×§ï¦p¤U

Sub test2()
Set d = CreateObject("scripting.dictionary")
Dim Rn&, Cn&, arr, tt$
Sheets("data").Activate
Rn = Sheet2.Cells(Rows.Count, 1).End(xlUp).Row
Cn = Cells(1, Columns.Count).End(xlToLeft).Column
For C = 2 To Cn
  tt = Cells(1, C).Value
  d(tt) = Cells(2, C).Resize(Rn - 1, 1)
Next C
Sheets("test").Activate
Cn = Cells(1, Columns.Count).End(xlToLeft).Column
For C = 2 To Cn
  tt = Cells(1, C).Value
  Cells(2, C).Resize(Rn - 1, 1) = d(tt)
Next C
End Sub

¨Ï¥Î数组©M¦r¨å1071004.rar (8.64 KB)
µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD