binaryfingers
Technical User
- Jul 26, 2002
- 118
Hi All
Skip, I found this code provided by you previously to insert a new line every x number of rows.
Can it be modified so that it inserts row 1 (containing header data) each time? I need to insert it every 72nd line.
Sub InsertEmptyRows()
'this is generally not a good idea
'a better choice is to change the row height
rStart = InputBox("Start in what row?")
If Not IsNumeric(rStart) Then Exit Sub
rEnd = InputBox("How many rows?")
If Not IsNumeric(rEnd) Then Exit Sub
For r = rStart + 5 To CInt(rEnd) + CInt(rStart) + 1 Step 6
Cells(r, 1).EntireRow.Insert shift:=xlUp
Next
End Sub
Hope you or somebody can help save me a lot of time!
Thanks,
Skip, I found this code provided by you previously to insert a new line every x number of rows.
Can it be modified so that it inserts row 1 (containing header data) each time? I need to insert it every 72nd line.
Sub InsertEmptyRows()
'this is generally not a good idea
'a better choice is to change the row height
rStart = InputBox("Start in what row?")
If Not IsNumeric(rStart) Then Exit Sub
rEnd = InputBox("How many rows?")
If Not IsNumeric(rEnd) Then Exit Sub
For r = rStart + 5 To CInt(rEnd) + CInt(rStart) + 1 Step 6
Cells(r, 1).EntireRow.Insert shift:=xlUp
Next
End Sub
Hope you or somebody can help save me a lot of time!
Thanks,