我在一个工作表中有一个表(“ table1”)。我有一个按钮,该按钮将表中的数据添加到另一个工作表(“ table”)中的另一个表中。每次它覆盖数据时。 我想将data(“ table1”)添加到table(“ table2”)而不是覆盖它。 这是代码:
Sheets("Letter (P V)").ListObjects("Table1").Range.Copy _
Destination:=Sheets("Actual").Range("E2")
谢谢!
答案 0 :(得分:0)
我想你想要这样的东西
Dim ws As Worksheet
Dim rangeToPaste As Range
Set ws = Sheets("Actual")
'go up from the bottom to the first row populated in column 5(E) after do +1 to paste after the last row'
Set rangeToPaste = ws.Range("E" & ws.Cells(ws.rows.Count, 5).End(xlUp).row + 1)
Sheets("Letter (P V)").ListObjects("Table1").Range.Copy Destination:=rangeToPaste