Copy all data (B1 to last cell) and paste in another sheet from C2

narsi412

New Member
Joined
Jun 5, 2015
Messages
1
Hi,

I need to copy all the data in the excel sheet from Cell B1 to the last cell and paste the copied data in another sheet from C2. I tried with below code but its not working. Suggest me how to do it.

Set sh4 = Sheets("QRY_ExportMatrix")
Set sh5 = Sheets("Matrix")
lr = sh4.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = sh4.Range("A1:A" & lr)
Sheets("Matrix").Select
Range("C2").Select
rng.EntireRow.Copy sh5.Cells(Rows.Count, 1).End(xlUp)(2)

Thanks & regards,
Narsi
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
loose
Set rng = sh4.Range("A1:A" & lr)
Sheets("Matrix").Select
Range("C2").Select
rng.EntireRow.Copy sh5.Cells(Rows.Count, 1).End(xlUp)(2)

replace with

Sheets("QRY_ExportMatrix").Range("b1:b" & LR).Copy Destination:=Sheets("Matrix").Range("c2")
 
Upvote 0

Forum statistics

Threads
1,203,435
Messages
6,055,353
Members
444,781
Latest member
rishivar

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