Insert # Rows based on numeric cell value and copy entire row to all inserted rows help

Keith412

New Member
Joined
Mar 2, 2008
Messages
41
[TABLE="width: 500"]
<tbody>[TR]
[TD]Location
[/TD]
[TD]#
[/TD]
[TD]Month
[/TD]
[TD]Year
[/TD]
[/TR]
[TR]
[TD]NYC
[/TD]
[TD]5
[/TD]
[TD]July
[/TD]
[TD]2019
[/TD]
[/TR]
[TR]
[TD]Florida
[/TD]
[TD]3
[/TD]
[TD]August
[/TD]
[TD]2019
[/TD]
[/TR]
[TR]
[TD]Mass
[/TD]
[TD]1
[/TD]
[TD]October
[/TD]
[TD]2019
[/TD]
[/TR]
</tbody>[/TABLE]
I have a workbook with the above information:


I would want it to look at column B, (#) and then insert 5 rows where the #= 1, so 1,1,1,1, instead of the 5:

[TABLE="width: 167"]
<colgroup><col width="97" style="width: 73pt; mso-width-source: userset; mso-width-alt: 3547;"> <col width="43" style="width: 32pt; mso-width-source: userset; mso-width-alt: 1572;"> <col width="46" style="width: 35pt; mso-width-source: userset; mso-width-alt: 1682;"> <col width="36" style="width: 27pt; mso-width-source: userset; mso-width-alt: 1316;"> <tbody>[TR]
[TD="width: 97, bgcolor: #B1E0A4"]Location[/TD]
[TD="width: 43, bgcolor: #B1E0A4"] # [/TD]
[TD="width: 46, bgcolor: #B1E0A4"]Month[/TD]
[TD="width: 36, bgcolor: #B1E0A4"]Year[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]New York[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]New York[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]New York[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]New York[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]New York[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Florida[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jun[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Florida[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jun[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Florida[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jun[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Florida[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Massachusetts[/TD]
[TD="bgcolor: transparent"] 1 [/TD]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[/TR]
</tbody>[/TABLE]
 
Actually I tweaked it and I got it to work, but not for the last four columns (they all show as blank). Example of columns H through K

[TABLE="width: 188"]
<colgroup><col width="48" style="width: 36pt; mso-width-source: userset; mso-width-alt: 1755;"> <col width="35" style="width: 26pt; mso-width-source: userset; mso-width-alt: 1280;"> <col width="96" style="width: 72pt; mso-width-source: userset; mso-width-alt: 3510;"> <col width="72" style="width: 54pt; mso-width-source: userset; mso-width-alt: 2633;"> <tbody>[TR]
[TD="width: 48, bgcolor: transparent"]Month[/TD]
[TD="width: 35, bgcolor: transparent"]Year[/TD]
[TD="width: 96, bgcolor: transparent"]Finance Salary[/TD]
[TD="width: 72, bgcolor: transparent"]$ Run Rate[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]Jul[/TD]
[TD="bgcolor: transparent"]2019[/TD]
[TD="bgcolor: transparent"]12,257[/TD]
[TD="bgcolor: transparent"]12,257[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Do you have a header in every column of row1?
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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