Creating a Copy/Paste Loop

  • Thread starter Thread starter Bonbon622
  • Start date Start date
B

Bonbon622

Hello all! I'm brand new to macros and VBA. I've searched
everywhere, but can't seem to come up with a solution for this simple
task. I have 45 rows x 4 columns worth of data that need to be copied
down in 51 row increments (no column movement). Right now I'm using
the code below and it works once, but I need to highlight the newly
created cell and repeat manually. The last row to paste the selection
on is 1565. I have no idea how to make it loop. Any help would be
greatly appreciated!

ActiveCell.Resize(45, 4).Copy.ActiveCell.Offset(51, 0)
Application.CopyCutMode = False
 
This will go to row 1575.

Sub cpy51()
lstRw = Cells(Rows.Count, 1).End(xlUp).Row
Do Until lstRw >= 1565
ActiveCell.Resize(45, 4).Copy ActiveCell.Offset(51, 0)
lstRw = lstRw + 51
Range("A" & lstRw - 44).Activate
Loop
End Sub
 

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

Back
Top