copy and paste range in new other document

shewendavelaar

New Member
Joined
Feb 19, 2019
Messages
9
Hi,

I've been trying to copy a variable range of rows form one sheet to another. The other sheet already contains data so I've tryinging to append it with the count.row function.
This is what I have so far:

Lastrow = Worksheets("input").Cells(Rows.Count, 7).End(xlUp).Row




Worksheets("input").Range(Cells(2, 1), Cells(Lastrow, 19)).Select
Selection.Copy
Workbooks.Open ("H:\Team 4\Proxy Voting\Global Proxy Voting\Zwitserland\CSV converter\Database\Swiss Connect Enterprise.xlsx")
lastrow1 = Worksheets("Swiss_Connect_Enterprise").Cells(Rows.Count, 1).End(xlUp).Row
Lastrow2 = lastrow1 + Lastrow
Lastrow3 = lastrow1 + 1
Worksheets("Swiss_Connect_Enterprise").Range(Cells(Lastrow3, 2), Cells(Lastrow2, 19)).Paste
Windows("CSV file converter rek. nummers.xlsm").Activate

Can someone help me solve this problem?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
As you haven't told us what the problem is, this is a guess.
Code:
   LastRow = Worksheets("input").Cells(Rows.Count, 7).End(xlUp).Row
   
   With Worksheets("input")
      .Range(.Cells(2, 1), .Cells(LastRow, 19)).Select
      Selection.Copy
   End With
   Workbooks.Open ("H:\Team 4\Proxy Voting\Global Proxy Voting\Zwitserland\CSV converter\Database\Swiss Connect Enterprise.xlsx")
   LastRow1 = Worksheets("Swiss_Connect_Enterprise").Cells(Rows.Count, 1).End(xlUp).Row
   LastRow2 = LastRow1 + LastRow
   Lastrow3 = LastRow1 + 1
   With Worksheets("Swiss_Connect_Enterprise")
      .Range(.Cells(Lastrow3, 2), .Cells(LastRow2, 19)).PasteSpecial
   End With
   Windows("CSV file converter rek. nummers.xlsm").Activate
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top