0

我正在复制一个数组 (Sheet1!A2:A831) 并想将其粘贴到 Sheet2 上!从 A1 开始,每 26 行。

我正在使用这个宏,但我遇到了一些麻烦:

Sub test()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("Sheet1!A2:A831").Copy
For i = 26 To LR Step 26
    Range("A" & i).PasteSpecial Paste:=xlPasteFormulas
Next i
End Sub
4

1 回答 1

0

这是你正在尝试的吗?

Sub test()
    Dim LR As Long, i As Long, n As Long

    With Sheets("Sheet1")
        LR = .Range("A" & .Rows.Count).End(xlUp).Row

        n = 1

        For i = 2 To LR 'A2:A831
            .Range("A" & i).Copy
            Sheets("Sheet2").Range("A" & n).PasteSpecial _
            Paste:=xlPasteFormulas

            n = n + 25
        Next i
    End With
End Sub
于 2012-07-06T08:39:40.407 回答