View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
bmorris bmorris is offline
external usenet poster
 
Posts: 3
Default How to insert rows after each row of data (800 rows)?

Bernie,

I copied the macro and pasted just like this:

Sub InsertEvenMoreBlankRows()
Dim myA As Range
For Each myA In Columns("A:A").SpecialCells(xlCellTypeBlanks).Area s
myA.Cells(myA.Rows.Count).EntireRow.Insert
Next myA
End Sub

The macro runs, but makes no changes. What I have is like this in Col A,
beginning at Row 1 and going down. No info is in Col B or beyond:

Row 1: data a
Row 2: data a
Row 3: data a
Row 4: BLANK
Row 5: data b

and so on. What i need to do it to add a blank row after Row 4, so there
are now (2) BLANK rows be between "data a" and "data b". Not all groups of
data (a - z) have (3) rows each; some groups have (5) or (6)....

Did I paste the macro incorrectly? Thanks for your help.

"Bernie Deitrick" wrote:

bmorris,

Assuming that your filled/blank rows extend ot column A:

Sub InsertEvenMoreBlankRows()

Dim myA As Range

For Each myA In Columns("A:A").SpecialCells(xlCellTypeBlanks).Area s
myA.Cells(myA.Rows.Count).EntireRow.Insert
Next myA

End Sub

HTH,
Bernie
MS Excel MVP


"bmorris" wrote in message
...
Toppers, your macro worked great. New problem. I have 2400 lines of
data,
with a blank row every 4 or 5 rows. I need to insert an additional blank
row
right after the existing one only, not after each row. Can you help?

"Toppers" wrote:

Sub InsertBlankRow()
For r = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
Rows(r).Insert Shift:=xlDown
Next r
end sub

"Jess" wrote:

I need a spreadsheet with a blank row between each row of data. There
are
800 rows of data. Is there an easy way to accomplish this?