将部分行移至第二行,将部分行移至第三行

我有一个问题,我不知道是否有出路。 我有一个大的电子表格(8000行),我需要操纵,其中数据被放入额外的列时,它应该已被放入第二和第三行。 每个条目跨越一个大行,而不是3个小行,因为它应该是。 所以现在我需要在每个现有的行之后创build两个新行。 然后在CF列中获取数据,并将其移动到下一行(AD列)。 然后取GH列,并将其移到该系列的第3行(Columns AB)。

所以一个例子是:

原始数据:

A1 A2 A3 A4 A5 A6 A7 A8 B1 B2 B3 B4 B5 B6 B7 B8 

结果数据:

 A1 A2 A3 A4 A5 A6 A7 A8 B1 B2 B3 B4 B5 B6 B7 B8 

依此类推,直到8000行变成24000(或32000)行。 那里有什么帮助吗?

谢谢!

你可以用这个。 尽pipe可能需要一点点完成。 它循环遍历8000行,每行数据插入2行,并将原始数据复制到相应的行:

 Sub main() Dim i As Integer Dim intRow As Integer intRow = 2 Application.ScreenUpdating = False For i = 1 To 8000 Rows(intRow).Insert Cells(intRow, 1) = Cells(intRow - 1, 3) Cells(intRow, 2) = Cells(intRow - 1, 4) Cells(intRow, 3) = Cells(intRow - 1, 5) Cells(intRow, 4) = Cells(intRow - 1, 6) Cells(intRow - 1, 3) = "" Cells(intRow - 1, 4) = "" Cells(intRow - 1, 5) = "" Cells(intRow - 1, 6) = "" intRow = intRow + 1 Rows(intRow).Insert Cells(intRow, 1) = Cells(intRow - 2, 7) Cells(intRow, 2) = Cells(intRow - 2, 8) Cells(intRow - 2, 7) = "" Cells(intRow - 2, 8) = "" intRow = intRow + 2 Next i Application.ScreenUpdating = True End Sub