Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Loop to copy rows down

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ordnance1 - 14 Mar 2008 05:23 GMT
I need some sort of loop rRoutine which will copy the current row down 1 row
at a time until it reaches row 4000
reklamo - 14 Mar 2008 08:42 GMT
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 need some sort of loop rRoutine which will copy the current row down 1 row
> at a time until it reaches row 4000
Patrick C. Simonds - 14 Mar 2008 14:52 GMT
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.

> Your goal is hardly to understand. Do you want to copy all rows (from row
> 1
[quoted text clipped - 6 lines]
>> row
>> at a time until it reaches row 4000
michael.beckinsale - 14 Mar 2008 17:39 GMT
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
reklamo - 14 Mar 2008 18:03 GMT
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

> Hi Patrick,
>
[quoted text clipped - 10 lines]
>
> Michael
Rick Rothstein (MVP - VB) - 14 Mar 2008 22:34 GMT
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

> Hi Patrick,
>
[quoted text clipped - 10 lines]
>
> Michael
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.