Insert rows everyother row
I want to insert a new row everyother row. How can I do that?
|
Insert rows everyother row
Try this example Mathew
Sub test() Application.ScreenUpdating = False Dim R As Long Dim rng As Range Set rng = ActiveSheet.UsedRange For R = rng.Rows.Count To 1 Step -1 rng.Rows(R + 1).Resize(1).EntireRow.insert Next R Application.ScreenUpdating = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Mathewnelson" wrote in message ... I want to insert a new row everyother row. How can I do that? |
Insert rows everyother row
say what ? :-)
"Mathewnelson" skrev: I want to insert a new row everyother row. How can I do that? |
Insert rows everyother row
Do you really need the inserted rows?
If just for appearance, select the rows and double the height. If really need the rows, see Ron's posting. Gord Dibben MS Excel MVP On Fri, 21 Jul 2006 09:12:01 -0700, Mathewnelson wrote: I want to insert a new row everyother row. How can I do that? |
Insert rows everyother row
OK, let's say you have 5 rows in a block. Insert a column on the left, and create a series 1,3,5,7 and 9. Then in the cells below that, create a series 2,4,6 and 8 (insert blank rows first if you have to). Then select the whole matrix and sort on the new column. The blank rows will end up between your original rows. Regards Mike -- Mikeopolo ------------------------------------------------------------------------ Mikeopolo's Profile: http://www.excelforum.com/member.php...o&userid=18570 View this thread: http://www.excelforum.com/showthread...hreadid=563792 |
Insert rows everyother row
Use this macro: Sub Macro1() For i = 2 To 10 Step 2 Range("A" & i).Select Selection.EntireRow.Insert Next End Sub -- raypayette ------------------------------------------------------------------------ raypayette's Profile: http://www.excelforum.com/member.php...o&userid=29569 View this thread: http://www.excelforum.com/showthread...hreadid=563791 |
All times are GMT +1. The time now is 11:14 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com