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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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.

Result
Material1Material2 Material1Material2
4000000000150000000201 4000000000150000000201
4000000000250000000202 4000000000250000000201
50000000203 4000000000150000000202
50000000204 4000000000250000000202
4000000000150000000203
4000000000250000000203
4000000000150000000204
4000000000250000000204

<colgroup><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
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,213,487
Messages
6,113,941
Members
448,534
Latest member
benefuexx

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