Thread: INSERT ROWS
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default INSERT ROWS

This will give you a little more control over the number of rows that are
inserted:
Sub InsertBlankRows()
'-- Ken Wright, 2003-08-09
Application.ScreenUpdating = False
Dim numRows As Long
Dim r As Long
Dim Rng As Range
Dim lastrw As Long
numRows = InputBox("How many Rows")
lastrw = Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = Range(Cells(1, "A"), Cells(lastrw, "A"))
For r = Rng.Rows.Count To 1 Step -3
Rng.Rows(r + 1).Resize(numRows).EntireRow.Insert
Next r
Application.ScreenUpdating = True
End Sub


Found the macro he
http://www.mvps.org/dmcritchie/excel/insrtrow.htm


Regards,
Ryan--

--
RyGuy


"pmss" wrote:

hello

Can somebody write me a code to insert some rows after certain rows. i have
data like this
1
5
6
6
8
10
12
...
...
i have to insert 2 number of rows in every 3 data interval. Means i have to
insert 2 rows after 6 and 12 and so on upto end.

thanks