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

[µo°Ý] ¦p¦ó§ó²µuªº¼¶¼gFor°j°é

[µo°Ý] ¦p¦ó§ó²µuªº¼¶¼gFor°j°é

¥»©«³Ì«á¥Ñ av8d ©ó 2023-10-15 19:05 ½s¿è
  1.     For i = 2 To 21
  2.         If Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 3) <> "" Then
  3.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i + 7, 3) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 4)
  4.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i + 7, 4) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 16)
  5.         End If
  6.     Next
  7.     For i = 22 To 41
  8.         If Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 3) <> "" Then
  9.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i + 9, 3) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 4)
  10.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i + 9, 4) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 16)
  11.         End If
  12.     Next
  13.     For i = 42 To 61
  14.         If Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 3) <> "" Then
  15.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i + 11, 3) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 4)
  16.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i + 11, 4) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(i, 16)
  17.         End If
  18.     Next
½Æ»s¥N½X
10/15 19:05 ­«·s¼¶¼g

°j°éi¦@¦³300¦C¡A½Ð°Ý«e½ú¬O§_¯à¦³¤ñ¸û²µuªº¼gªk¡AÁÂÁ¡I

¦^´_ 1# av8d

10/15 19:25 ¸Ñ¶}¤F¡AÁÂÁÂÆ[¬Ý
  1.     a = 1
  2.     b = 29 '²Ä¤@¦¸Â_ÂI
  3.     c = 22 'Â_ÂI
  4.     For i = 9 To 300
  5.         a = a + 1
  6.         If i = b Then
  7.             i = i + 2 'Â_2®æ
  8.             b = b + c
  9.         End If
  10.         If Workbooks("¤â¥U2.xls").Sheets(1).Cells(a, 3) <> "" Then
  11.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i, 3) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(a, 4)
  12.             Workbooks("±¾¸¹.xls").Sheets(1).Cells(i, 4) = Workbooks("¤â¥U2.xls").Sheets(1).Cells(a, 16)
  13.         End If
  14.     Next
½Æ»s¥N½X

TOP

Option Explicit
Sub TEST()
Dim i%, R&, xR1 As Range, xR2 As Range
Set xR1 = Workbooks("¤â¥U2.xls").Sheets(1).Cells
Set xR2 = Workbooks("±¾¸¹.xls").Sheets(1).Cells
For i = 9 To 300
   R = i + ((i - 9) \ 20) * 2: If R > 300 Then Exit For
   If xR1(i - 7, 3) <> "" Then xR2(R, 3) = xR1(i - 7, 4): xR2(R, 4) = xR1(i - 7, 16)
Next
Set xR1 = Nothing: Set xR2 = Nothing
End Sub
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD