Excel for循环自动复制

我试图做一个循环,以特定的时间间隔复制一个特定的select到一个新的范围或一个新的范围。

这是我的代码:

Sub test() Dim i As Long Dim c As Integer c = 0 For i = 1 To 119 Step 3 c = c + i + 120 Range(Cells(i, 1), Cells(i, 4)).Copy Range("A(c)") Next i End Sub 

但它不起作用。 有人能帮助我吗?

谢谢!!!!!!

非常感谢你。 我以这种方式解决了这个问题,使其更加紧凑:

 Sub test() Dim i As Long Dim c As Integer Dim c2 As Integer c = 0 c2 = 0 For i = 1 To 119 Step 3 c2 = c2 + 1 c = c2 + 120 Range(Cells(i, 1), Cells(i, 4)).Copy Cells(c, 1) Next i End Sub 

如果您只想select要复制的范围而不实际复制任何内容:

 Sub test() Dim i As Long Dim rngCopy As Range For i = 1 To 119 Step 3 If rngCopy Is Nothing Then Set rngCopy = Range(Cells(i, 1), Cells(i, 4)) Else Set rngCopy = Application.Union(rngCopy, _ Range(Cells(i, 1), Cells(i, 4)) ) End If Next i rngCopy.Select End Sub