Inserting Rows....in large spreadsheet (part 1)

IGinc

Board Regular
Joined
Jun 14, 2009
Messages
148
Tackling a project......ill keep my questions seperate (as i have another question related to this spreadsheet)

on to the question..

.... I have an excel spreadsheet from a Vendor with 1000+ rows of data. What Id like to/need to accomplish is insert 24 rows in between each row of exisiting data. With my limited knowledge, I only know how to Copy and paste, this could take forever.....thanks in advance...
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hello and welcome to MrExcel.

Press ALT + F11 to open the Visual Basic Editor, Insert > Module and paste in

Code:
Sub InsRows()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = LR To 2 Step -1
    Range("A" & i).Resize(24).EntireRow.Insert
Next i
Application.ScreenUpdating = True
End Sub

Press ALT + Q to return to your sheet, Tools > Macro > Macros, click on InsRows then click the Run button.
 
Upvote 0
Thanks for the warm welcome and quick response. Is there a way to alter the code to have 539 be the first line that is spaced 24 lines...i had already started the project.
 
Upvote 0
Try

Rich (BB code):
Sub InsRows()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = LR To 539 Step -1
    Range("A" & i).Resize(24).EntireRow.Insert
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Re: Filling down....in large spreadsheet (part 2)

worked like a charm. =).

Part 2...

Fill O:AA Down 24 rows which were created, 25th row, 0:AA fill down the next 24, and so on???
 
Upvote 0

Forum statistics

Threads
1,215,295
Messages
6,124,103
Members
449,142
Latest member
championbowler

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top