Separate data in columns to match a specific number of rows

zgsharon

New Member
Joined
May 19, 2016
Messages
3
Had no Idea how to title this, so to start with if anyone has a better title please help me out. New to Mr.Excel and hoping someone knows what I'm attempting to do. I am trying separate a specific number of rows in multiple columns to match another set of data with a greater number of rows. So I want to take the data in columns A, B, and C (see example below) and make the same data match the number of rows in D, E, and F with blank cells filling in the extra rows. So basically I need to spread a specific column of data into a new column with a set range of rows.


[TABLE="width: 448"]
<tbody>[TR]
[TD="width: 64"]A[/TD]
[TD="width: 64"] B[/TD]
[TD="width: 64"] C[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"] D[/TD]
[TD="width: 64"] E[/TD]
[TD="width: 64"] F[/TD]
[/TR]
[TR]
[TD="width: 64"]6[/TD]
[TD="width: 64"]6[/TD]
[TD="width: 64"]6[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]5[/TD]
[TD="width: 64"]5[/TD]
[TD="width: 64"]4[/TD]
[/TR]
[TR]
[TD]45[/TD]
[TD]45[/TD]
[TD]45[/TD]
[TD][/TD]
[TD]64[/TD]
[TD]45[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]4[/TD]
[TD][/TD]
[TD]43[/TD]
[TD]4[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]234[/TD]
[TD]23[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]64[/TD]
[TD]46[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]234[/TD]
[TD]64[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]24[/TD]
[TD]2[/TD]
[TD]43[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]34[/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5[/TD]
[TD]4[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[TD]56[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD]23[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Hoping that it would look something like this.

[TABLE="width: 448"]
<tbody>[TR]
[TD="width: 64"]A[/TD]
[TD="width: 64"]B[/TD]
[TD="width: 64"]C[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]D[/TD]
[TD="width: 64"]E[/TD]
[TD="width: 64"]F[/TD]
[/TR]
[TR]
[TD="width: 64"]6[/TD]
[TD="width: 64"]6[/TD]
[TD="width: 64"]6[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]5[/TD]
[TD="width: 64"]5[/TD]
[TD="width: 64"]4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]64[/TD]
[TD]45[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]43[/TD]
[TD]4[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]234[/TD]
[TD]23[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]45[/TD]
[TD]45[/TD]
[TD]45[/TD]
[TD][/TD]
[TD]64[/TD]
[TD]46[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]234[/TD]
[TD]64[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]24[/TD]
[TD]2[/TD]
[TD]43[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]34[/TD]
[TD]34[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[TD]4[/TD]
[TD][/TD]
[TD]5[/TD]
[TD]4[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]6[/TD]
[TD]56[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4[/TD]
[TD]23[/TD]
[TD]32[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]5[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]23[/TD]
[TD]4[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]


I know the number of rows in the first three columns won't always be a multiple of the other three columns, I just need it to keep the first and last values of each set of data lined up with each other in the same row. The values in between can be spaced randomly, as they are above.

I have found this code, and it helps a little, but I don't know how to make the code do multiple columns at once.
Sub MG28Sep05()
Dim Last As Integer, n
' Change "A" Below To another column Letter
Last = Range("A" & Rows.Count).End(xlUp).row

For n = Last To 2 Step -1
' Change "7" Below To No of Blank Rows Required
Cells(n, 1).Resize(7).Insert shift:=xlDown
Next n
End Sub


Thanks for any help in advance. I apologize for the terrible explanation, just hoping someone has wanted to attempt to do the same thing. I am using Office 365 on windows. Let me know if you need any more information
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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