Copy/paste range of cells in a column and loop until column ends

wassmer

New Member
Joined
Mar 6, 2013
Messages
17
Hi guys,

I recorded a macro but I am unable to take it to the next level and automatize the same procedure until the row ends. I am sure this is an easy problem for most of you:
Range("B2").Select
Range("B2:B49").Select
Selection.Copy
Range("D2").Select
ActiveSheet.Paste
Range("B50:B97").Select
Selection.Copy
Range("E2").Select
ActiveSheet.Paste
Range("B98:B97").Select
Selection.Copy
Range("F2").Select
ActiveSheet.Paste

It is always 48 rows that need to be copied - preferably into another sheet of the same excel file into subsequent columns - 1st 48 values into column A, 2nd 48 values into column B until column B ends.

Thanks so much in advance!

Tom
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try This
Sheets name you can change as per yours sheets name where you want to paste data


Sub Copy_Paste()
Set pstrng = Sheets("Sheet2").Range("HO1").End(xlToLeft)
Range("b2").Select
Do Until ActiveCell.Value = ""
Range(ActiveCell, ActiveCell.Offset(47, 0)).Copy pstrng
ActiveCell.Offset(48, 0).Select
Set pstrng = Sheets("Sheet2").Range("HO1").End(xlToLeft).Offset(0, 1)
Loop
End Sub
 
Last edited:
Upvote 0
Thanks a lot kevatarvind!!! - it works! If I want to change the range from 48 values to say 288 values, I would just change 47 to 287, and 48 to 288 right?
 
Upvote 0

Forum statistics

Threads
1,216,073
Messages
6,128,637
Members
449,461
Latest member
kokoanutt

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