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

[µo°Ý] ¯S©w­È°j°é¼gªk

[µo°Ý] ¯S©w­È°j°é¼gªk

¦U¦ì¤j¤j¦n
·Q½Ð±Ð°j°é¼gªk¡A
­n§â¤u§@ªí1ªº­È(AÄæ)¡A
¶K¨ì¤u§@ªí2ªºA~CÄæ¨Ã«ö·Ó¶¶§Ç¡A
¥Ø«eªº¼gªk¬O¥Î¾l¼Æ¤è¦¡(MOD)³B²z¸õÄ檺°ÝÃD
  1.     For i = 0 To 14
  2.    
  3.         Cells(1 + Int(i / 3), 1 + (i Mod 3)) = .Cells(1 + i, 1).Value

  4.     Next
½Æ»s¥N½X
·Q½Ð°Ý¬O¤£¬O¦³¦A¦h¤@­Ó°j°é¼gªk¡A
¥u­«½Æ¤T­Ó­È¡A¦p[0,1,2]°}¦C¡A
¥i¥HÅý§Ú±a¤Jcells¸Ì­±°õ¦æ¸õÄ檺°Ê§@¡A
ÁٽФj¤j­Ì«ü¾É¡AÁÂÁ¡C

¬¡­¶Ã¯1.rar (15.81 KB)

google"EXCEL°g"  blog  ©Îgoogleºô§}:https://hcm19522.blogspot.com/

TOP

  1. Sub zz()
  2. Dim c, n&
  3. c = Array(0, 1, 2)
  4. For i = 1 To 15 Step UBound(c) + 1
  5.     n = n + 1
  6.     For Each j In c
  7.         Cells(n, j + 1) = i + j
  8.     Next
  9. Next
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# hcm19522
·PÁ¤j¤j!¾Ç¨ì¤F

TOP

¦^´_ 3# ikboy
·PÁ¤j¤j!¬Oarray¨S¿ù!

TOP

µù¸Ñ
  1. Sub zz()
  2. Dim c, n&   '©w¸qc¡BnÅܼƬ°long(±`¾ã¼Æ)
  3. c = Array(0, 1, 2)   'c µ¥©ó°}¦C(0,1,2)·í§@¸õÄæÅܼÆ
  4. For i = 1 To 15 Step UBound(c) + 1   '°j°é1¨ì15¡A¥H3¬°¶¡¹j(Ubound(c)=2)
  5.     n = n + 1          '¤º´¡ÅܼÆn(¦CªºÅܼÆ)¡Aj¬°array¸Ìªº0,1,2
  6.     For Each j In c  'nªì©l­È0·|±a¥X1¡A¨Ã°j°é0,1,2
  7.         Cells(n, j + 1) = i + j   '±a¥Xcells(1,1)=1¡Bcells(1,2)=2¡Bcells(1,3)=3
  8.     Next '´`Àôn·|¦A+1¡AÅýcells¸õ¤U¤@¦C
  9. Next
  10. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤£­n¤p¬Ý¦Û¤v¡A¦]¬°¤H¦³µL­­ªº¥i¯à¡C
ªð¦^¦Cªí ¤W¤@¥DÃD