Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Inserting rows

I need a macro to insert two rows at every 6th row.

Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Inserting rows

Starting at which row? You can tweak something like this to your
needs.
Sub foo()
Dim n As Long
n = 6
botrow = Cells(Rows.Count, 1).End(xlUp).Row
Do Until n = botrow
Range("A1").Offset(n, 0).EntireRow.Insert
n = n + 6
botrow = botrow + 1
Loop
End Sub

Scotty wrote:
I need a macro to insert two rows at every 6th row.

Thank you.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Inserting rows

If I wanted to insert 5 rows for every 1 row. How would I change the below
macro?

Thanks

"JW" wrote:

Starting at which row? You can tweak something like this to your
needs.
Sub foo()
Dim n As Long
n = 6
botrow = Cells(Rows.Count, 1).End(xlUp).Row
Do Until n = botrow
Range("A1").Offset(n, 0).EntireRow.Insert
n = n + 6
botrow = botrow + 1
Loop
End Sub

Scotty wrote:
I need a macro to insert two rows at every 6th row.

Thank you.



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
inserting rows inbetween rows of data ? Azeem Excel Discussion (Misc queries) 1 October 27th 09 07:38 AM
Copying & Inserting Rows w/o Affecting other Rows Etc. LRay67 Excel Worksheet Functions 1 October 22nd 08 02:10 AM
Inserting Blank rows after every row upto 2500 rows Manju Excel Worksheet Functions 8 August 22nd 06 12:54 PM
Why is inserting rows throwing off my hidden rows jgeniti[_2_] Excel Programming 4 March 9th 06 11:25 PM
Inserting multiple rows in excel with data in consecutive rows technotronic Excel Programming 2 October 20th 05 03:12 PM


All times are GMT +1. The time now is 03:24 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"