2

我想知道如何从第 41 行开始粘贴它。提前致谢。

A.胡克

Sub COPY()

    Dim nextrow As Long
    Dim i As Integer
    i = 41

    nextrow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row + 1


    With Sheet1
        .Range("a2").COPY Sheet2.Range("A" & nextrow)
        .Range("b2").COPY Sheet2.Range("B" & nextrow)
        .Range("C2").COPY Sheet2.Range("C" & nextrow)
        .Range("d2").COPY Sheet2.Range("D" & nextrow)
        .Range("e2").COPY Sheet2.Range("E" & nextrow)
        .Range("f2").COPY Sheet2.Range("F" & nextrow)
        .Range("g2").COPY Sheet2.Range("G" & nextrow)
    End With


End Sub
4

2 回答 2

3

你的意思是这样吗?

Sub COPY()

    Dim nextrow As Long
    Dim i As Integer

    i = 41

    nextrow = WorksheetFunction.Max(i, Sheet2.Cells(Rows.Count, "A").End(xlUp).Row + 1)
    Sheet1.Range("a2:g2").COPY Sheet2.Cells(nextrow, "A")

End Sub
于 2013-09-27T15:52:45.620 回答
0

怎么样:

Sub COPY()
    Dim nextrow As Long
    Dim i As Integer
    i = 41
    nextrow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row + 1
    With Sheet1
        .Range("a" & i).COPY Sheet2.Range("A" & nextrow)
        .Range("b" & i).COPY Sheet2.Range("B" & nextrow)
        .Range("C" & i).COPY Sheet2.Range("C" & nextrow)
        .Range("d" & i).COPY Sheet2.Range("D" & nextrow)
        .Range("e" & i).COPY Sheet2.Range("E" & nextrow)
        .Range("f" & i).COPY Sheet2.Range("F" & nextrow)
        .Range("g" & i).COPY Sheet2.Range("G" & nextrow)
    End With
End Sub
于 2013-09-27T15:56:03.317 回答