Loop to copy rows down

  • Thread starter Thread starter ordnance1
  • Start date Start date
O

ordnance1

I need some sort of loop rRoutine which will copy the current row down 1 row
at a time until it reaches row 4000
 
Your goal is hardly to understand. Do you want to copy all rows (from row 1
to row 4000) one row down? Or ?? Please explain a little bit more in detail.
regards
reklamo
 
I thought it was pretty clear but I will try again.

Lets say that I am currently on row 87, I want something that will copy the
data in row 87 and then paste that data in to each row below row 87 until it
reaches row 4000.
 
Hi Patrick,

I haven't seen your orignal post so l dont know exactly what you are
trying to achieve but this will do as you ask without having to loop

Sub PasteRows()
Rows("88:88").Copy
Rows("89:4000").Activate
ActiveSheet.Paste
End Sub

HTH

Michael
 
To read first the actual slected row you can use following:

Sub Makro1()
ActualRow = Selection.Row
Rows(ActualRow).Copy
Rows(ActualRow + 1 & ":4000").Select
ActiveSheet.Paste
Cells(ActualRow, 1).Select
Application.CutCopyMode = False
End Sub

regards
reklamo
 
Your references to Rows 88 and 89 appear to be off by one... 'reklamo'
mentioned Row 87 and the rows below it. Adjusting for that, you macro can be
simplified as follows...

Sub PasteRows()
Rows("87:87").Copy Rows("88:4000")
End Sub

Rick
 

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