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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
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,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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