Insert Lines

R

RENEE

I have a worksheet sent to me with over 700 names on it. I need to put 4
extra lines under each name. Is there a way to do this without having to
individually insert those lines as this will take a long time. Thanks.
 
A

alanglloyd

I have a worksheet sent to me with over 700 names on it. �I need to put 4
extra lines under each name. �Is there a way to do this without having to
individually insert those lines as this will take a long time. �Thanks.

Output as CSV
Open in word processor
replace one new para with 4 new paras
save as .txt file
change extension to csv
open in XL & save as a worksheet.

Alan Lloyd
 
D

Dave Peterson

Check your other post.
I have a worksheet sent to me with over 700 names on it. I need to put 4
extra lines under each name. Is there a way to do this without having to
individually insert those lines as this will take a long time. Thanks.
 
R

RENEE

Sorry - I lost you at "replace one new para with 4 new paras". I copied
some of the lines into Word, but couldn't figure out what you mean by the
foregoing.

Then, save as .txt file and change the extension from txt to csv? Then copy
to Excel? Or, is it possible to open a word file as an excel file?

Thank you.
 
B

Billns

I have a worksheet sent to me with over 700 names on it. I need to put 4
extra lines under each name. Is there a way to do this without having to
individually insert those lines as this will take a long time. Thanks.

Record a macro to insert four lines and move down one line, then repeat
it as needed.

Bill
 
G

Gord Dibben

Assumes names are in column A

Sub rowsinsertfour()
'don guillett
For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
If Cells(i, 1) <> "" Then _
Cells(i, 1).Resize(4, 1).entirerow.Insert
Next i
End Sub

If you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP
 
B

Billns

Assumes names are in column A

Sub rowsinsertfour()
'don guillett
For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
If Cells(i, 1)<> "" Then _
Cells(i, 1).Resize(4, 1).entirerow.Insert
Next i
End Sub

If you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

or Ron de De Bruin's site on where to store macros.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to Tool>Macro>Macros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP
Thanks, Gord, for jumping in with the details...

Bill
 

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

Top