Copy and Paste a set range in the next empty row

前端 未结 4 1137
时光取名叫无心
时光取名叫无心 2020-12-15 13:19

This should be simple but I am having a tough time.. I want to copy the cells A3 through E3, and paste them into the next empty row on a different worksheet. I have used thi

4条回答
  •  Happy的楠姐
    2020-12-15 14:23

    You could also try this

    Private Sub CommandButton1_Click()
    
    Sheets("Sheet1").Range("A3:E3").Copy
    
    Dim lastrow As Long
    lastrow = Range("A65536").End(xlUp).Row
    
    Sheets("Summary Info").Activate
    Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    
    End Sub
    

提交回复
热议问题