Adding a blank line after each line of data

P

Pablo

Hi, anyone know how I can add a blank line (row) after each line of data in
a spreadsheet? (I have thousands of lines to do this with). Thanks kindly.
Pablo.
 
M

mudraker

Pablo

Try this macro on a backup copy of your data

It assums your data is in column A



Sub addBlankRow()
Dim lRow As Long

If Cells(Rows.Count, "a"). _
End(xlUp).Row * 2 > Rows.Count Then
MsgBox "Too Many Rows Of Data" & Chr(10) & Chr(10) _
& "Can Not Add Blank Row After Each Entry", vbCritical
End
End If
For lRow = Cells(Rows.Count, "a"). _
End(xlUp).Row - 1 To 1 Step -1
If Cells(lRow, "a") <> "" And _
Cells(lRow + 1, "a") <> "" Then
Rows(lRow + 1).Insert
End If
Next lRow

End Su
 
D

Dave Peterson

Is this for just making it look pretty?

If yes, then select all the rows (ctrl-a, (2 times in xl2003)) and adjust the
rowheight to double.

Same look, lots easier.

(and filters/charts/pivottables are easier to work with, too.)
 
M

Mark E. Philpot

Sub NewLine()
Dim cell As Range

Columns("A").Select
For Each cell In Selection
If cell <> "" Then
cell.Offset(1, 0).EntireRow.Insert
End If
Next
End Sub
 
Top