Copy (“A2:A26â€) paste, offset one cell, do it again. Loop 256 tim

R

RyGuy

I am trying to figure out a way to take a range (“A2:A26â€) and copy/paste it
into range (“D55:D79â€) then offset one cell down, then do it again, so
(“A2:A26â€) copy/paste to (“D81:D105â€) and so on and so forth. I want it to
run 256 times.

I am looking for a sample of code that I thought I had somewhere in my
library, but can’t seem to find it now. Any ideas?

Thanks,
Ryan--
 
M

Mike H

Hi,

Try this

Sub Versive()
Range("A2:A26").Copy
For x = 55 To 1430 Step 26
Cells(x, 4).PasteSpecial
Next
End Sub

Mike
 
R

RyGuy

Thanks! Very cool. This macro worked pretty well too:

Sub CopyDown()
Dim lstRw As Long
lstRw = Cells(Rows.Count, 1).End(xlUp).Row
Do Until lstRw >= 7000
ActiveCell.Resize(26, 1).Copy ActiveCell.Offset(26, 0)
lstRw = lstRw + 2
Range("A" & lstRw - 9).Activate
Loop
End Sub

It was off by one row, so I inserted one cell down, and everything lined up
nicely.

Hope this helps others.


Thanks again Mike!
Ryan--
 
M

Mike H

Glad I could help and thanks for the feedback

RyGuy said:
Thanks! Very cool. This macro worked pretty well too:

Sub CopyDown()
Dim lstRw As Long
lstRw = Cells(Rows.Count, 1).End(xlUp).Row
Do Until lstRw >= 7000
ActiveCell.Resize(26, 1).Copy ActiveCell.Offset(26, 0)
lstRw = lstRw + 2
Range("A" & lstRw - 9).Activate
Loop
End Sub

It was off by one row, so I inserted one cell down, and everything lined up
nicely.

Hope this helps others.


Thanks again Mike!
Ryan--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top