Paste a range

sweeneytime

Board Regular
Joined
Aug 23, 2010
Messages
183
Hi guys,

I have a range ("B2:J" & Last Row) which takes an input, calculates, then I wish to paste the results to the last row of another sheet. I could do it with an ordinary selection.copy and paste, but the loop runs approx 4000 times and is rather slow.

I found some efficent code I am trying to adapt.

HTML:
Sheet2.Range("B1:B200").Value= Sheet1.Range("A1:A200").Value


My attempt: But it only pastes in the first cell of the range. I need to paste the whole range. Some sort of ("A" & LR:"I" & LR)
HTML:
Sheets("Pivot Data").Range("A" & LR2 + 1).Value = Sheets("Data Setup").Range("B2:J" & LR1).Value


Any solutions or other suggestions would be appreciated.

Cheers,
Sweeneytime
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi, sweeneytime,

you may try
Code:
Sheets("Pivot Data").Range("A" & LR2 + 1 & ":I" & LR2 + LR1).Value = Sheets("Data Setup").Range("B2:J" & LR1).Value
or
Code:
Sheets("Pivot Data").Range("A" & LR2 + 1).Resize(LR1 - 1, 9).Value = Sheets("Data Setup").Range("B2:J" & LR1).Value
If there aren´t any formulas in the area to copy you might like to check
Code:
Sheets("Data Setup").Range("B2:J" & LR1).Copy Destination:=Sheets("Pivot Data").Range("A" & LR2 + 1)
which will copy the format as well.

Ciao,
Holger
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,876
Members
452,363
Latest member
merico17

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