close

I hope you can help it will save a week of copy and paste. In column A I
have a list of account names. Lets say ABCDEFG, but there are 1000 names.
In column B I have a list of products, lets call them 1-2-3-4-5-6. I need to
create a two column list that combines the data so the account name repeats
for each product:

A 1
A 2
A 3
B 1
B 2
B 3
C 1

And so on..... Any help please!


I would suggest the following (should take a few minutes - find
something more enjoyable for the rest of the week).

Use the following macro.

Sub CopyStuff()
Set AccountNameRange = Application.InputBox(quot;Select account name
rangequot;, , , , , , , 8)
Set ProductRange = Application.InputBox(quot;Select product name rangequot;, ,
, , , , , 8)
Set StartCell = Application.InputBox(quot;Select cell in answer columnquot;, ,
, , , , , 8)
TargetColumn = StartCell.Column
For Each Account In AccountNameRange
For Each Product In ProductRange
Cells(65536, TargetColumn).End(xlUp).Offset(1, 0) = Account
Cells(65536, TargetColumn).End(xlUp).Offset(0, 1) = Product
Next Product
Next Account

End Sub--
mrice------------------------------------------------------------------------
mrice's Profile: www.excelforum.com/member.php...oamp;userid=10931
View this thread: www.excelforum.com/showthread...hreadid=532756My inelegant approach:
1) clear column B
2) in the first row of your table, in column B, enter product 1.
3) place the cursor on the fill-handle of that cell (bottom right; the
cursor will change to a smallish square) and double-click to fill that
product for each customer
4) go to the first row of data and click in column A of that row
5) select your entire data set from column A only (ctrl shift down arrow to
select all the data) and copy (ctrl c)
6) advance to the first blank cell in column A (ctrl down arrow, then down
arrow)
7) paste (ctrl v)
8) right-arrow to get to the first blank cell in column B, and enter the
next product
9) use the fill handle to fill in the product for each customer, as in step 3
Go back to the first row that has the latest product in it and click in
column A, then repeat steps 5-9 for the next product. Repeat for products 4,
5 and 6.
Finally, select columns A and B and use Data gt; Sort. In the sort dialog,
choose to sort by Column A then by Column B.

quot;karmaisgreatquot; wrote:

gt; I hope you can help it will save a week of copy and paste. In column A I
gt; have a list of account names. Lets say ABCDEFG, but there are 1000 names.
gt; In column B I have a list of products, lets call them 1-2-3-4-5-6. I need to
gt; create a two column list that combines the data so the account name repeats
gt; for each product:
gt;
gt; A 1
gt; A 2
gt; A 3
gt; B 1
gt; B 2
gt; B 3
gt; C 1
gt;
gt; And so on..... Any help please!

Set it up using formulas with if statements. Is there a way to attach an
example so you can see it?

QC Cougquot;karmaisgreatquot; wrote:

gt; I hope you can help it will save a week of copy and paste. In column A I
gt; have a list of account names. Lets say ABCDEFG, but there are 1000 names.
gt; In column B I have a list of products, lets call them 1-2-3-4-5-6. I need to
gt; create a two column list that combines the data so the account name repeats
gt; for each product:
gt;
gt; A 1
gt; A 2
gt; A 3
gt; B 1
gt; B 2
gt; B 3
gt; C 1
gt;
gt; And so on..... Any help please!

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()