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
Resolved · 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?
For upcoming training course dates see: Pricing & availability
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
|
