返回列表 上一主題 發帖

[發問] 不同欄位的資料,要如何堆疊到同一個表格?

回復 1# sandra_wang
  1. Sub Ex()
  2.     Dim Place%, Place_Row%, i%
  3.     Place = 214
  4.     Place_Row = 10
  5.     With ActiveSheet
  6.         If .Cells(Rows.Count, Place).End(xlUp).row >= Place_Row Then
  7.             .Range(.Cells(Place_Row, Place), .Cells(Rows.Count, Place).End(xlUp)).Resize(, 6).Clear
  8.         End If
  9.         For i = 179 To 179 + (7 * 4) Step 7
  10.             .Range(.Cells(Place_Row, i), .Cells(Rows.Count, i).End(xlUp)).Resize(, 6).Copy .Cells(Rows.Count, Place).End(xlUp).Cells(2, 1)
  11.         Next
  12.     End With
  13. End Sub
複製代碼

TOP

Sub yy()
Cells(9, 179).CurrentRegion.Copy Cells(9, 214)
For i = 186 To 212 Step 8
Cells(9, i).CurrentRegion.Offset(1, 0).Copy Cells(9, 214).End(4)(2, 1)
Next
End Sub

TOP

        靜思自在 : 人的心地是一畦田,土地沒有播下好種子,也長不出好的果實。 -
返回列表 上一主題