Inserting Lines

M

Mike Buretta

I have a spreadsheet that is several hundred lines in
lenght. I would like to insert a line between each row.
What is the easiest way to accomplish this task.

Thank you.
 
G

Gord Dibben

Mike

If the blank row is just for appearance sake, an alternative would be to just
increase the row heights so it looks double-spaced.

Otherwise, a macro is fast.

Sub InsertALTrows()
'David McRitchie, misc 2001-06-30
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i As Integer
For i = Selection(Selection.Count).Row To Selection(1).Row + 1 Step -1
Rows(i).EntireRow.Insert
''With Rows(i)
'' .RowHeight = 24.25
'' End With
Next i
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Gord Dibben Excel MVP
 
J

jeff

Hi,

Paste this macro in your worksheet;
Select your cells to insert rows. and run:

Sub NwLine()
For j = 1 To Selection.Count
Selection.Rows(j + 1).Insert
Selection.Offset(1, 0).Select
Next j
End Sub


jeff
 
M

Mike Buretta

Worked great!!!!!

Thanks.
-----Original Message-----
Mike

If the blank row is just for appearance sake, an alternative would be to just
increase the row heights so it looks double-spaced.

Otherwise, a macro is fast.

Sub InsertALTrows()
'David McRitchie, misc 2001-06-30
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim i As Integer
For i = Selection(Selection.Count).Row To Selection (1).Row + 1 Step -1
Rows(i).EntireRow.Insert
''With Rows(i)
'' .RowHeight = 24.25
'' End With
Next i
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Gord Dibben Excel MVP



.
 
D

Dave Peterson

If you're only doing this for appearance sake, then how about just doubling the
rowheight.

(just in case you weren't actually using those new rows.)
 
Top