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

advanced excel course - inserting new rows repeatedly

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

advanced excel course - Inserting new rows repeatedly in a spreadsheet

ResolvedVersion 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:

Separate the year from a date

To separate the year from a date use the =year() function, eg a date is in cell A1 and in A2 you wish to display the year enter the function =year(A1)

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.