Insert blank row and copy row to new blank row

DTMnBHM

New Member
Joined
Dec 27, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I'm trying to manipulate a spreadsheet with approx 1600 rows of data. I need to insert 1 blank row in between a set or rows, then copy the data above, or below (I'm not sure if when the new row is inserted if it goes above or below the selected rows to copy), into the new blank row. New to the forum and apologize in advance if this has been discussed. I searched and couldn't find my exact need.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
A blank row can be added above, or below, any row number. What determines where the row should be added. Will it be the same number of rows until the end of the Sheet? When data is copied, will it only be one row, or multiple? Details man! 😁
 
Upvote 0
A blank row can be added above, or below, any row number. What determines where the row should be added. Will it be the same number of rows until the end of the Sheet? When data is copied, will it only be one row, or multiple? Details man! 😁
Thanks...I'm trying.

It doesn't matter if it's above or below.

Basically I need the data in a row copied into the new blank rows directly above or below.

For some portion of the spreadsheet I only need 1 blank row added (in between multiple rows) and copied. Some I will need 2 blank rows added and copied, and then the remaining will be 3.

For instance, lets say for rows 1-100. I need a blank row inserted between each, and the data from the original 100 rows copied into the new blank rows.

Then, for rows 101-200. I need 2 blank rows inserted between each, and the data from each row copied into the 2 blanks inserted between.

And so on
 
Upvote 0
What you are saying makes no sense to me. I have included a visual representation (truncated 10 rows = 100 rows) in my understanding of your request. If it is accurate, please let me know.

Original Data
Book1
A
11
22
33
44
55
66
77
88
99
1010
1111
1212
1313
1414
1515
1616
1717
1818
1919
2020
2121
2222
2323
2424
2525
2626
2727
2828
2929
3030
3131
3232
3333
3434
3535
3636
3737
3838
3939
4040
Sheet1


Changed Data
Book1
A
11
21
32
42
53
63
74
84
95
105
116
126
137
147
158
168
179
189
1910
2010
2110
2211
2311
2411
2512
2612
2712
2813
2913
3014
3114
3214
3315
3415
3515
3616
3716
3816
3917
4017
4117
4218
4318
4418
4519
4619
4719
4820
4920
5020
5121
5221
5321
5422
5522
5622
5723
5823
5922
6024
6124
6224
6325
6425
6525
6626
6726
6826
6927
7027
7127
7228
7328
7428
7529
7629
7729
7830
7930
8030
8131
8231
8331
8432
8532
8632
8733
8833
8933
9034
9134
9234
9335
9435
9535
9636
9736
9836
9937
10037
10137
10238
10338
10438
10539
10639
10739
10840
10940
11040
111
112
Sheet1
 
Upvote 0
Yes. Only difference is there's 6 columns per row with data and I need all data in the row copied to the new blank row(s)
 
Upvote 0
Hmmm, who will be adding the blank rows? Like will you or someone else be manually inserting new rows into the sheet with the data?
 
Upvote 0
Hmmm, who will be adding the blank rows? Like will you or someone else be manually inserting new rows into the sheet with the data?
I hope not. That's what I'm trying to figure out if it's something I can do using a script or something. I know how to manually add rows in between others rather quickly, but it's the copy of the data that would take me forever to do manually
 
Upvote 0
In that case, I'm with @Skyybot in that we need more information. What determines the amount of rows that will be added? How would we know which rows will need 1 blank row in between and which will need 2 etc. Unless we know this, we can't build a formula or write a code to assist.

Maybe I can provide a code that will look at your data and copy the data from the rows above as you need. But it wouldn't insert the rows for you.
 
Last edited:
Upvote 0
In that case, I'm with @Skyybot in that we need more information. What determines the amount of rows that will be added? How would we know which rows will need 1 blank row in between and which will need 2 etc. Unless we know this, we can't build a formula or write a code to assist.

Maybe I can provide a code that will look at your data and copy the data from the rows above as you need. But it wouldn't insert the rows for you.
Ok. I will separate the rows manually and add them to separate sheets.

1 sheet will be needing 1 row added and the other sheet will need 2 rows added. Would that simplify? When I'm done, I could just combine them back into 1 sheet.
 
Upvote 0
Hmmm, any chance you can paste a sample of what your data looks like(omitting any personal information information)? Will 1 sheet be needing a row inserted after every row and the other sheet need 2 rows inserted after every row?

In the meantime since you mentioned there are 6 columns with the data, this code

VBA Code:
Sub FillDown()
  With Range("A1:G" & Range("G" & Rows.Count).End(xlUp).Row)
    .SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C"
    .Value = .Value
  End With
End Sub

will get you from this:
PERSONAL.xlsm
ABCDEFGH
11deeeee
2
32rdrdrd
4
53fdfdfd
6
74FhFhFh
8
Sheet5


To this:

PERSONAL.xlsm
ABCDEFGH
11deeeee
21deeeee
32rdrdrd
42rdrdrd
53fdfdfd
63fdfdfd
74FhFhFh
8
Sheet5
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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