advanced excel course - inserting new rows repeatedly

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel Training and help » advanced excel course - Inserting new rows repeatedly in a spreadsheet | Excel forum

advanced excel course - Inserting new rows repeatedly in a spreadsheet | Excel forum

resolvedResolved · Low Priority · Version Standard

Doug has attended:
Excel Intermediate course
Excel Advanced course

Inserting new rows repeatedly in a spreadsheet

Hello,

I have created a spreadsheet with thousands of items on it. I now have to insert 2 empty rows below each existing row of data. Is there a quick way of doing this please?

RE: Inserting new rows repeatedly in a spreadsheet

Doug

To do this you need to create a macro:

1. Open Tools/ Macro/ Macros

2. Click the Edit button

In the code view area

1. Open Insert And select Module.

In the module code area (on the right) insert the following macro.

Sub InsertRows()

' Macro created 17/10/2007 by Carlos

'**In Here insert the address of the first cell to contain data in the table eg
'Range("A5").Select

ActiveCell.Offset(1, 0).Range("A1:A2").Select
Selection.EntireRow.Insert

ActiveCell.Offset(2, 0).Range("A1").Select

Do While ActiveCell.Value <> ""

ActiveCell.Offset(1, 0).Range("A1:A2").Select
Selection.EntireRow.Insert

ActiveCell.Offset(2, 0).Range("A1").Select

Loop

End Sub


Hope this helps

Carlos

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Concatenating Results of Formulas

To concatenate the results of formulas simply add the "&" after the formula or function closing bracket.

function1(....)&function2(.....)

see example Creating a range of monthly payments as text.

View all Excel hints and tips


Server loaded in 0.08 secs.