答案 0 :(得分:0)
我认为这是一项非常简单的任务,而且你说这听起来很难。这是帮助您解决问题的代码。
Sub do_something()
last_row = ThisWorkbook.Worksheets("Sheet1").Cells(1, 1).End(xlDown).Row
j = 1
For i = 1 To last_row
If i Mod 8 = 0 Then
j = j + 1
End If
Cells(j, 2).Value = Cells(i, 1).Value
j = j + 1
Next i
End Sub
正如您在评论中提到的,下面的代码将满足您的需求。
Sub do_something2()
last_row = ThisWorkbook.Worksheets("Sheet1").Cells(1, 1).End(xlDown).Row
j = 1
i = 1
Do While i <= last_row
Worksheets("Sheet2").Range(Worksheets("Sheet2").Cells(j, 1),
Worksheets("Sheet2").Cells(j + 6, 1)).Value = _
Worksheets("Sheet1").Range(Worksheets("Sheet1").Cells(i, 1),
Worksheets("Sheet1").Cells(i + 6, 1)).Value
j = j + 8
i = i + 7
Loop
End Sub