Cell Distribution

dhen21dx

Board Regular
Joined
May 10, 2013
Messages
166
Hello,

Just want to ask if there is an easy way to distribute the data from Column A to Column B, the result will be on Column D&E.
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Let me try again...

Your question is too vague for anyone to be able to answer. What data? What do you mean by 'distribute'? What does '...the result will be on Column D&E" mean etc etc.

A worked example would help...
 
Upvote 0
Here is the sample: Column A = Material1; B = Material2, D&E is the combination result.

[TABLE="width: 408"]
<colgroup><col><col><col><col span="2"></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="colspan: 2"]Result[/TD]
[/TR]
[TR]
[TD]Material1[/TD]
[TD]Material2[/TD]
[TD] [/TD]
[TD]Material1[/TD]
[TD]Material2[/TD]
[/TR]
[TR]
[TD="align: right"]40000000001[/TD]
[TD="align: right"]50000000201[/TD]
[TD] [/TD]
[TD="align: right"]40000000001[/TD]
[TD="align: right"]50000000201[/TD]
[/TR]
[TR]
[TD="align: right"]40000000002[/TD]
[TD="align: right"]50000000202[/TD]
[TD] [/TD]
[TD="align: right"]40000000002[/TD]
[TD="align: right"]50000000201[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD="align: right"]50000000203[/TD]
[TD] [/TD]
[TD="align: right"]40000000001[/TD]
[TD="align: right"]50000000202[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD="align: right"]50000000204[/TD]
[TD] [/TD]
[TD="align: right"]40000000002[/TD]
[TD="align: right"]50000000202[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]40000000001[/TD]
[TD="align: right"]50000000203[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]40000000002[/TD]
[TD="align: right"]50000000203[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]40000000001[/TD]
[TD="align: right"]50000000204[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]40000000002[/TD]
[TD="align: right"]50000000204[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Give this macro a try...
Code:
[table="width: 500"]
[tr]
	[td]Sub Distribute()
  Dim X As Long, R As Long, Acount As Long, Bcount As Long
  Acount = Range("A2", Cells(Rows.Count, "A").End(xlUp)).Rows.Count
  Bcount = Range("B2", Cells(Rows.Count, "B").End(xlUp)).Rows.Count
  Range("D1:E1").Value = Range("A1:B1").Value
  For X = 1 To Bcount
    R = Cells(Rows.Count, "D").End(xlUp).Offset(1).Row
    Cells(R, "D").Resize(Acount).Value = Range("A2", Cells(Rows.Count, "A").End(xlUp)).Value
    Cells(R, "E").Resize(Acount).Value = Cells(1 + X, "B").Value
  Next
End Sub[/td]
[/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,190
Members
452,616
Latest member
intern444

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