Inserting Lines

  • Thread starter Thread starter Mike Buretta
  • Start date Start date
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.
 
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
 
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
 
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



.
 
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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top