Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default How do I insert a row or rows between each row of text and copy the row above?

I have been using this macro to insert rows depending on how many I need.

When I need more rows interested I just change the number by numRows=

I would like to know how I can copy the row above to the new inserted row. I would like to do this for large amounts of data. As of now I just do this manually and it can be very time consuming.

Sub InsertRows()
Application.ScreenUpdating = False
Dim numRows As Integer
Dim r As Long
numRows = 1
For r = 265 To 1 Step -1
ActiveSheet.Rows(r + 1).Resize(numRows).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/Insert rows Niniel Excel Discussion (Misc queries) 2 August 31st 07 10:28 PM
Button to insert rows on mutiple worksheets and copy text and info chuck_galda Excel Programming 1 June 1st 07 07:51 PM
text box insert in Excel - text box lines print on second copy Diana (Berry & Co) Excel Discussion (Misc queries) 0 July 26th 06 04:39 AM
Copy Rows and insert these rows before a page break AQ Mahomed Excel Programming 0 June 8th 04 09:09 AM
Copy insert rows TonyG Excel Programming 0 October 30th 03 12:14 AM


All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"